public class LucenePropertyIndex
extends org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndex
To define a lucene index on a subtree you have to add an
oak:index node.
Under it follows the index definition node that:
oak:QueryIndexDefinitiontype property set to luceneasync property set to asyncOptionally you can add
includePropertyTypes propertyexcludePropertyNames propertyreindex flag which when set to true, 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");
}
QueryIndexorg.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.IteratorRewoundStateProviderQueryIndex.AdvancedQueryIndex, QueryIndex.AdvanceFulltextQueryIndex, QueryIndex.FulltextQueryIndex, QueryIndex.IndexPlan, QueryIndex.NativeQueryIndex, QueryIndex.NodeAggregator, QueryIndex.OrderEntry| Modifier and Type | Field and Description |
|---|---|
static String |
CACHE_FACET_RESULTS_NAME |
static int |
LUCENE_QUERY_BATCH_SIZE
Batch size for fetching results from Lucene queries.
|
static String |
OLD_FACET_PROVIDER_CONFIG_NAME |
| Constructor and Description |
|---|
LucenePropertyIndex(IndexTracker tracker) |
LucenePropertyIndex(IndexTracker tracker,
IndexAugmentorFactory augmentorFactory) |
| Modifier and Type | Method and Description |
|---|---|
String |
getIndexName()
Get the generic index name (normally the index type).
|
double |
getMinimumCost()
Returns the minimum cost which
QueryIndex.getCost(Filter, NodeState) would return in the best possible case. |
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.
|
Cursor |
query(QueryIndex.IndexPlan plan,
NodeState rootState)
Start a query.
|
determinePropertyType, getCost, getNodeAggregator, getPathRestriction, getPlan, getPlanDescription, getPlans, isNodePath, parseFacetField, queryequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndexNamepublic static final String OLD_FACET_PROVIDER_CONFIG_NAME
public static final String CACHE_FACET_RESULTS_NAME
public static final int LUCENE_QUERY_BATCH_SIZE
public LucenePropertyIndex(IndexTracker tracker)
public LucenePropertyIndex(IndexTracker tracker, IndexAugmentorFactory augmentorFactory)
public double getMinimumCost()
QueryIndexQueryIndex.getCost(Filter, NodeState) would return in the best possible case.
The implementation should return a static/cached value because it is called very often.
public String getIndexName()
QueryIndexpublic Cursor query(QueryIndex.IndexPlan plan, NodeState rootState)
QueryIndex.AdvancedQueryIndexThe index plan is one of the plans that the index returned in the getPlans call.
plan - the index plan to userootState - root state of the current repository snapshot@NotNull public static @NotNull org.apache.jackrabbit.oak.plugins.index.lucene.LuceneRequestFacade<Query> performAdditionalWraps(@NotNull @NotNull List<Query> qs)
qs - the list of queries. Cannot be null.Copyright © 2010 - 2020 Adobe. All Rights Reserved