Class LucenePropertyIndex
java.lang.Object
org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex
org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex
- All Implemented Interfaces:
QueryIndex,QueryIndex.AdvancedQueryIndex,QueryIndex.AdvanceFulltextQueryIndex,QueryIndex.FulltextQueryIndex,QueryIndex.NativeQueryIndex
public class LucenePropertyIndex
extends org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex
Used to query new (compatVersion 2) Lucene indexes.
Provides a QueryIndex that does lookups against a Lucene-based index
To define a lucene index on a subtree you have to add an
oak:index node.
Under it follows the index definition node that:
- must be of type
oak:QueryIndexDefinition - must have the
typeproperty set tolucene - must have the
asyncproperty set toasync
Optionally you can add
- what subset of property types to be included in the index via the
includePropertyTypesproperty - a blacklist of property names: what property to be excluded from the index via the
excludePropertyNamesproperty - the
reindexflag which when set totrue, triggers a full content re-index.
{
NodeBuilder index = root.child("oak:index");
index.child("lucene")
.setProperty("jcr:primaryType", "oak:QueryIndexDefinition", Type.NAME)
.setProperty("type", "lucene")
.setProperty("async", "async")
.setProperty("reindex", "true");
}
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex
org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex.Facet, org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex.FacetProvider, org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex.FulltextResultRow, org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex.IteratorRewoundStateProviderNested classes/interfaces inherited from interface org.apache.jackrabbit.oak.spi.query.QueryIndex
QueryIndex.AdvancedQueryIndex, QueryIndex.AdvanceFulltextQueryIndex, QueryIndex.FulltextQueryIndex, QueryIndex.IndexPlan, QueryIndex.NativeQueryIndex, QueryIndex.NodeAggregator, QueryIndex.OrderEntry -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final intBatch size for fetching results from Lucene queries.static final StringFields inherited from class org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex
ATTR_PLAN_RESULT -
Constructor Summary
ConstructorsConstructorDescriptionLucenePropertyIndex(IndexTracker tracker) LucenePropertyIndex(IndexTracker tracker, IndexAugmentorFactory augmentorFactory) -
Method Summary
Modifier and TypeMethodDescriptionGet the generic index name (normally the index type).static @NotNull org.apache.jackrabbit.oak.plugins.index.lucene.LuceneRequestFacade<Query> performAdditionalWraps(@NotNull List<Query> qs) Perform additional wraps on the list of queries to allow, for example, the NOT CONTAINS to play properly when sent to lucene.query(QueryIndex.IndexPlan plan, NodeState rootState) Start a query.Methods inherited from class org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex
convertFacetFieldNameToColumnName, determinePropertyType, getCost, getMinimumCost, getNodeAggregator, getPathRestriction, getPlan, getPlanDescription, getPlans, isNodePath, parseFacetField, query, rewriteQueryTextMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jackrabbit.oak.spi.query.QueryIndex
getIndexName
-
Field Details
-
OLD_FACET_PROVIDER_CONFIG_NAME
- See Also:
-
CACHE_FACET_RESULTS_NAME
- See Also:
-
EAGER_FACET_CACHE_FILL_NAME
- See Also:
-
LUCENE_QUERY_BATCH_SIZE
public static final int LUCENE_QUERY_BATCH_SIZEBatch size for fetching results from Lucene queries.- See Also:
-
-
Constructor Details
-
LucenePropertyIndex
-
LucenePropertyIndex
-
-
Method Details
-
getIndexName
Description copied from interface:QueryIndexGet the generic index name (normally the index type).- Returns:
- the index name
-
query
Description copied from interface:QueryIndex.AdvancedQueryIndexStart a query. The filter and sort order of the index plan is to be used.The index plan is one of the plans that the index returned in the getPlans call.
- Parameters:
plan- the index plan to userootState- root state of the current repository snapshot- Returns:
- a cursor to iterate over the result
-
performAdditionalWraps
@NotNull public static @NotNull org.apache.jackrabbit.oak.plugins.index.lucene.LuceneRequestFacade<Query> performAdditionalWraps(@NotNull @NotNull List<Query> qs) Perform additional wraps on the list of queries to allow, for example, the NOT CONTAINS to play properly when sent to lucene.- Parameters:
qs- the list of queries. Cannot be null.- Returns:
- the request facade
-