org.apache.jackrabbit.oak.plugins.index.lucene
Class LuceneIndex
java.lang.Object
org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndex
- All Implemented Interfaces:
- org.apache.jackrabbit.oak.spi.query.QueryIndex, org.apache.jackrabbit.oak.spi.query.QueryIndex.FulltextQueryIndex
public class LuceneIndex
- extends Object
- implements org.apache.jackrabbit.oak.spi.query.QueryIndex.FulltextQueryIndex
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
type property set to lucene
- must have the
async property set to async
Optionally you can add
- what subset of property types to be included in the index via the
includePropertyTypes property
- a blacklist of property names: what property to be excluded from the index via the
excludePropertyNames property
- the
reindex 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");
}
- See Also:
QueryIndex
| Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.spi.query.QueryIndex |
org.apache.jackrabbit.oak.spi.query.QueryIndex.AdvancedQueryIndex, org.apache.jackrabbit.oak.spi.query.QueryIndex.FulltextQueryIndex, org.apache.jackrabbit.oak.spi.query.QueryIndex.IndexPlan, org.apache.jackrabbit.oak.spi.query.QueryIndex.OrderEntry |
|
Constructor Summary |
LuceneIndex(org.apache.jackrabbit.oak.plugins.index.lucene.IndexTracker tracker,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.jackrabbit.oak.plugins.index.aggregate.NodeAggregator aggregator)
|
|
Method Summary |
double |
getCost(org.apache.jackrabbit.oak.spi.query.Filter filter,
org.apache.jackrabbit.oak.spi.state.NodeState root)
|
String |
getIndexName()
|
org.apache.jackrabbit.oak.plugins.index.aggregate.NodeAggregator |
getNodeAggregator()
|
String |
getPlan(org.apache.jackrabbit.oak.spi.query.Filter filter,
org.apache.jackrabbit.oak.spi.state.NodeState root)
|
org.apache.jackrabbit.oak.spi.query.Cursor |
query(org.apache.jackrabbit.oak.spi.query.Filter filter,
org.apache.jackrabbit.oak.spi.state.NodeState root)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NATIVE_QUERY_FUNCTION
public static final String NATIVE_QUERY_FUNCTION
- See Also:
- Constant Field Values
LuceneIndex
public LuceneIndex(org.apache.jackrabbit.oak.plugins.index.lucene.IndexTracker tracker,
org.apache.lucene.analysis.Analyzer analyzer,
org.apache.jackrabbit.oak.plugins.index.aggregate.NodeAggregator aggregator)
getIndexName
public String getIndexName()
- Specified by:
getIndexName in interface org.apache.jackrabbit.oak.spi.query.QueryIndex
getCost
public double getCost(org.apache.jackrabbit.oak.spi.query.Filter filter,
org.apache.jackrabbit.oak.spi.state.NodeState root)
- Specified by:
getCost in interface org.apache.jackrabbit.oak.spi.query.QueryIndex
getPlan
public String getPlan(org.apache.jackrabbit.oak.spi.query.Filter filter,
org.apache.jackrabbit.oak.spi.state.NodeState root)
- Specified by:
getPlan in interface org.apache.jackrabbit.oak.spi.query.QueryIndex
query
public org.apache.jackrabbit.oak.spi.query.Cursor query(org.apache.jackrabbit.oak.spi.query.Filter filter,
org.apache.jackrabbit.oak.spi.state.NodeState root)
- Specified by:
query in interface org.apache.jackrabbit.oak.spi.query.QueryIndex
getNodeAggregator
public org.apache.jackrabbit.oak.plugins.index.aggregate.NodeAggregator getNodeAggregator()
- Specified by:
getNodeAggregator in interface org.apache.jackrabbit.oak.spi.query.QueryIndex.FulltextQueryIndex
Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.