public class BasicLuceneSchema extends Object implements LuceneSchema
node information.| Constructor and Description |
|---|
BasicLuceneSchema(ExecutionContext context,
org.hibernate.search.engine.spi.SearchFactoryImplementor searchFactory,
org.apache.lucene.util.Version version,
boolean enableFullTextSearch) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBinaryToIndex(Binary binary,
org.hibernate.search.backend.TransactionContext txnCtx) |
protected DynamicField |
addDynamicField(String propertyName,
Object value,
DynamicField previous,
org.apache.lucene.document.Field.Store stored,
boolean fullTextSearchable,
StringBuilder fullText)
Create a dynamic field to store the property value.
|
void |
addToIndex(String workspace,
NodeKey key,
Path path,
Name primaryType,
Set<Name> mixinTypes,
Iterator<Property> propertiesIterator,
NodeTypeSchemata schemata,
org.hibernate.search.backend.TransactionContext txnCtx)
Add to the index the information about a node.
|
LuceneQueryFactory |
createLuceneQueryFactory(QueryContext context,
org.hibernate.search.SearchFactory searchFactory) |
LuceneQuery |
createQuery(SelectorName selectorName,
List<Constraint> andedConstraints,
LuceneProcessingContext processingContext)
Create a
LuceneQuery for the supplied ANDed constraints of the ModeShape access query, which comes from the leaves
of a query plan. |
LuceneQueryEngine.TupleCollector |
createTupleCollector(QueryContext queryContext,
QueryResults.Columns columns) |
org.hibernate.search.indexes.impl.IndexManagerHolder |
getAllIndexesManager()
Returns the global index manager.
|
boolean |
initializedIndexes()
Retrieve whether the indexes were initialized and empty upon startup.
|
protected NodeInfo |
nodeInfo(String id,
String workspace,
Path path,
Name primaryType,
Set<Name> mixinTypes,
Iterator<Property> propertyIterator,
NodeTypeSchemata schemata) |
void |
removeAllFromIndex(String workspace,
org.hibernate.search.backend.TransactionContext txnCtx) |
void |
removeBinariesFromIndex(Iterable<String> sha1s,
org.hibernate.search.backend.TransactionContext txnCtx) |
void |
removeFromIndex(String workspace,
Iterable<NodeKey> keys,
org.hibernate.search.backend.TransactionContext txnCtx) |
void |
shutdown()
Attempts to stop any active work items
|
protected String |
stringFrom(Name name) |
protected String |
stringFrom(Path path) |
void |
updateIndex(String workspace,
NodeKey key,
Path path,
Name primaryType,
Set<Name> mixinTypes,
Iterator<Property> properties,
NodeTypeSchemata schemata,
org.hibernate.search.backend.TransactionContext txnCtx)
Update the index to reflect the new state of the node.
|
public BasicLuceneSchema(ExecutionContext context, org.hibernate.search.engine.spi.SearchFactoryImplementor searchFactory, org.apache.lucene.util.Version version, boolean enableFullTextSearch)
context - the execution context for the repositorysearchFactory - the search factory for accessing the indexesversion - the Lucene versionenableFullTextSearch - true if full-text searching is enabled, or false otherwisepublic void shutdown()
public LuceneQueryFactory createLuceneQueryFactory(QueryContext context, org.hibernate.search.SearchFactory searchFactory)
createLuceneQueryFactory in interface LuceneSchemapublic org.hibernate.search.indexes.impl.IndexManagerHolder getAllIndexesManager()
IndexManagerHolder instance.protected final NodeInfo nodeInfo(String id, String workspace, Path path, Name primaryType, Set<Name> mixinTypes, Iterator<Property> propertyIterator, NodeTypeSchemata schemata)
protected final DynamicField addDynamicField(String propertyName, Object value, DynamicField previous, org.apache.lucene.document.Field.Store stored, boolean fullTextSearchable, StringBuilder fullText)
propertyName - the name of the field in which the property value is to be stored; never nullvalue - the property value; may be nullprevious - the previous DynamicField; may be nullstored - true if the value is to be stored so it can be used in comparison criteriafullTextSearchable - true if this property value should be full-text searchablefullText - the node's full-text search text to which any full-text searchable terms should be added; will not be null
if fullTextSearchable is trueprevious if none are createdpublic void addToIndex(String workspace, NodeKey key, Path path, Name primaryType, Set<Name> mixinTypes, Iterator<Property> propertiesIterator, NodeTypeSchemata schemata, org.hibernate.search.backend.TransactionContext txnCtx)
QueryIndexingaddToIndex in interface QueryIndexingworkspace - the workspace in which the node information should be available; may not be nullkey - the unique key for the node; may not be nullpath - the path of the node; may not be nullprimaryType - the primary type of the node; may not be nullmixinTypes - the mixin types for the node; may not be null but may be emptypropertiesIterator - the iterator over the properties of a node; may not be null but may be emptyschemata - the node type schemata that should be used to determine how the node is to be indexed; may not be nulltxnCtx - the transaction context in which the index updates should be made; may not be nullpublic void updateIndex(String workspace, NodeKey key, Path path, Name primaryType, Set<Name> mixinTypes, Iterator<Property> properties, NodeTypeSchemata schemata, org.hibernate.search.backend.TransactionContext txnCtx)
QueryIndexingupdateIndex in interface QueryIndexingworkspace - the workspace in which the node information should be available; may not be nullkey - the unique key for the node; may not be nullpath - the path of the node; may not be nullprimaryType - the primary type of the node; may not be nullmixinTypes - the mixin types for the node; may not be null but may be emptyproperties - the properties of the node; may not be null but may be emptyschemata - the node type schemata that should be used to determine how the node is to be indexed; may not be nulltxnCtx - the transaction context in which the index updates should be made; may not be nullpublic void removeFromIndex(String workspace, Iterable<NodeKey> keys, org.hibernate.search.backend.TransactionContext txnCtx)
removeFromIndex in interface QueryIndexingpublic void removeAllFromIndex(String workspace, org.hibernate.search.backend.TransactionContext txnCtx)
removeAllFromIndex in interface QueryIndexingpublic void addBinaryToIndex(Binary binary, org.hibernate.search.backend.TransactionContext txnCtx)
addBinaryToIndex in interface QueryIndexingpublic void removeBinariesFromIndex(Iterable<String> sha1s, org.hibernate.search.backend.TransactionContext txnCtx)
removeBinariesFromIndex in interface QueryIndexingpublic LuceneQuery createQuery(SelectorName selectorName, List<Constraint> andedConstraints, LuceneProcessingContext processingContext) throws LuceneException
LuceneSchemaLuceneQuery for the supplied ANDed constraints of the ModeShape access query, which comes from the leaves
of a query plan.createQuery in interface LuceneSchemaselectorName - the name of the selector (or node type); never nullandedConstraints - the constraints of the access query that are all ANDed together; never nullprocessingContext - the processing context; never nullLuceneExceptionpublic LuceneQueryEngine.TupleCollector createTupleCollector(QueryContext queryContext, QueryResults.Columns columns)
createTupleCollector in interface LuceneSchemapublic boolean initializedIndexes()
QueryIndexinginitializedIndexes in interface QueryIndexingCopyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.