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:QueryIndexDefinition
type
property set to lucene
async
property set to async
Optionally 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");
}
QueryIndex
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
QueryIndex.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 |
ATTR_PLAN_RESULT
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, query
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIndexName
public 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()
QueryIndex
QueryIndex.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()
QueryIndex
public Cursor query(QueryIndex.IndexPlan plan, NodeState rootState)
QueryIndex.AdvancedQueryIndex
The 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 - 2020 Adobe. All Rights Reserved