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.FulltextResultRowQueryIndex.AdvancedQueryIndex, QueryIndex.AdvanceFulltextQueryIndex, QueryIndex.FulltextQueryIndex, QueryIndex.IndexPlan, QueryIndex.NativeQueryIndex, QueryIndex.NodeAggregator, QueryIndex.OrderEntry| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CACHE_FACET_RESULTS_NAME |
static int |
LUCENE_QUERY_BATCH_SIZE
Batch size for fetching results from Lucene queries.
|
static java.lang.String |
OLD_FACET_PROVIDER_CONFIG_NAME |
| Constructor and Description |
|---|
LucenePropertyIndex(IndexTracker tracker) |
LucenePropertyIndex(IndexTracker tracker,
ScorerProviderFactory factory) |
LucenePropertyIndex(IndexTracker tracker,
ScorerProviderFactory factory,
IndexAugmentorFactory augmentorFactory) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.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<org.apache.lucene.search.Query> |
performAdditionalWraps(@NotNull java.util.List<org.apache.lucene.search.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.
|
getCost, getNodeAggregator, getPlan, getPlanDescription, getPlans, isNodePath, parseFacetField, queryequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndexNamepublic static final java.lang.String OLD_FACET_PROVIDER_CONFIG_NAME
public static final java.lang.String CACHE_FACET_RESULTS_NAME
public static final int LUCENE_QUERY_BATCH_SIZE
public LucenePropertyIndex(IndexTracker tracker)
public LucenePropertyIndex(IndexTracker tracker, ScorerProviderFactory factory)
public LucenePropertyIndex(IndexTracker tracker, ScorerProviderFactory factory, 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 java.lang.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<org.apache.lucene.search.Query> performAdditionalWraps(@NotNull
@NotNull java.util.List<org.apache.lucene.search.Query> qs)
qs - the list of queries. Cannot be null.Copyright © 2010 - 2023 Adobe. All Rights Reserved