|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.search.lucene.LuceneSearchSession
@NotThreadSafe public class LuceneSearchSession
The AbstractLuceneSearchEngine.WorkspaceSession
implementation for the LuceneSearchEngine
.
Nested Class Summary | |
---|---|
protected static class |
LuceneSearchSession.DualIndexTupleCollector
This collector is responsible for loading the value for each of the columns into each tuple array. |
protected static class |
LuceneSearchSession.FullTextSearchTupleCollector
This collector is responsible for loading the value for each of the columns into each tuple array. |
Field Summary | |
---|---|
protected static org.apache.lucene.document.FieldSelector |
LOCATION_FIELDS_SELECTOR
An immutable FieldSelector instance that accesses the UUID field. |
protected static int |
MAX_DEPTH
|
protected static int |
MAX_SNS_INDEX
|
protected static int |
MIN_DEPTH
|
protected static int |
MIN_SNS_INDEX
|
protected static Set<Name> |
NON_SEARCHABLE_NAMES
|
protected LuceneSearchProcessor |
processor
|
Constructor Summary | |
---|---|
protected |
LuceneSearchSession(LuceneSearchWorkspace workspace,
LuceneSearchProcessor processor)
|
Method Summary | |
---|---|
void |
commit()
Subclasses should implement this method to commit and save any work that has been done with this processor. |
protected org.apache.lucene.search.Query |
createLocalNameQuery(String likeExpression,
boolean caseSensitive)
|
protected org.apache.lucene.search.Query |
createSnsIndexQuery(String likeExpression)
Utility method to generate a query against the SNS indexes. |
AbstractLuceneSearchEngine.TupleCollector |
createTupleCollector(QueryResults.Columns columns)
Create a AbstractLuceneSearchEngine.TupleCollector instance that collects the results from the index(es). |
org.apache.lucene.search.Query |
findAllNodesAtOrBelow(Path parentPath)
|
org.apache.lucene.search.Query |
findAllNodesBelow(Path parentPath)
|
org.apache.lucene.search.Query |
findAllNodesBelow(Path parentPath,
int maximumDepth)
|
org.apache.lucene.search.Query |
findChildNodes(Path parentPath)
Return a query that can be used to find all of the documents that represent nodes that are children of the node at the supplied path. |
org.apache.lucene.search.Query |
findNodeAt(Path path)
Create a query that can be used to find the one document (or node) that exists at the exact path supplied. |
org.apache.lucene.search.Query |
findNodesLike(String fieldName,
String likeExpression,
boolean caseSensitive)
Create a query that can be used to find documents (or nodes) that have a field value that satisfies the supplied LIKE expression. |
org.apache.lucene.search.Query |
findNodesWith(Length propertyLength,
Operator operator,
Object value)
|
org.apache.lucene.search.Query |
findNodesWith(NodeDepth depthConstraint,
Operator operator,
Object value)
|
org.apache.lucene.search.Query |
findNodesWith(NodeLocalName nodeName,
Operator operator,
Object value,
boolean caseSensitive)
|
org.apache.lucene.search.Query |
findNodesWith(NodeName nodeName,
Operator operator,
Object value,
boolean caseSensitive)
|
org.apache.lucene.search.Query |
findNodesWith(NodePath nodePath,
Operator operator,
Object value,
boolean caseSensitive)
|
org.apache.lucene.search.Query |
findNodesWith(PropertyValue propertyValue,
Operator operator,
Object value,
boolean caseSensitive)
|
org.apache.lucene.search.Query |
findNodesWith(ReferenceValue referenceValue,
Operator operator,
Object value)
|
org.apache.lucene.search.Query |
findNodesWithNumericRange(NodeDepth depth,
Object lowerValue,
Object upperValue,
boolean includesLower,
boolean includesUpper)
|
org.apache.lucene.search.Query |
findNodesWithNumericRange(PropertyValue propertyValue,
Object lowerValue,
Object upperValue,
boolean includesLower,
boolean includesUpper)
|
protected org.apache.lucene.search.Query |
findNodesWithNumericRange(String field,
Object lowerValue,
Object upperValue,
boolean includesLower,
boolean includesUpper)
|
org.apache.lucene.analysis.Analyzer |
getAnalyzer()
|
int |
getChangeCount()
Get the number of changes that have been made to the workspace using this session. |
protected org.apache.lucene.index.IndexReader |
getContentReader()
|
org.apache.lucene.search.IndexSearcher |
getContentSearcher()
|
protected org.apache.lucene.index.IndexWriter |
getContentWriter()
|
Location |
getLocationForRoot()
|
org.apache.lucene.util.Version |
getVersion()
|
LuceneSearchWorkspace |
getWorkspace()
|
String |
getWorkspaceName()
|
boolean |
hasWriters()
|
protected String |
likeExpresionForWildcardPath(String path)
|
protected Location |
readLocation(org.apache.lucene.document.Document doc)
|
protected void |
recordChange()
|
protected void |
recordChanges(int numberOfChanges)
|
void |
rollback()
Subclasses should implement this method to throw away any work that has been done with this processor. |
protected QueryResults.Statistics |
search(String fullTextSearchExpression,
List<Object[]> results,
int maxRows,
int offset)
|
protected void |
setOrReplaceProperties(Location location,
Iterable<Property> properties)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Set<Name> NON_SEARCHABLE_NAMES
protected static final org.apache.lucene.document.FieldSelector LOCATION_FIELDS_SELECTOR
FieldSelector
instance that accesses the UUID field.
protected static final int MIN_DEPTH
protected static final int MAX_DEPTH
protected static final int MIN_SNS_INDEX
protected static final int MAX_SNS_INDEX
protected final LuceneSearchProcessor processor
Constructor Detail |
---|
protected LuceneSearchSession(LuceneSearchWorkspace workspace, LuceneSearchProcessor processor)
Method Detail |
---|
public String getWorkspaceName()
getWorkspaceName
in interface AbstractLuceneSearchEngine.WorkspaceSession
AbstractLuceneSearchEngine.WorkspaceSession.getWorkspaceName()
public LuceneSearchWorkspace getWorkspace()
protected org.apache.lucene.index.IndexReader getContentReader() throws IOException
IOException
protected org.apache.lucene.index.IndexWriter getContentWriter() throws IOException
IOException
public org.apache.lucene.search.IndexSearcher getContentSearcher() throws IOException
getContentSearcher
in interface AbstractLuceneSearchEngine.WorkspaceSession
IOException
public org.apache.lucene.analysis.Analyzer getAnalyzer()
getAnalyzer
in interface AbstractLuceneSearchEngine.WorkspaceSession
AbstractLuceneSearchEngine.WorkspaceSession.getAnalyzer()
public org.apache.lucene.util.Version getVersion()
getVersion
in interface AbstractLuceneSearchEngine.WorkspaceSession
AbstractLuceneSearchEngine.WorkspaceSession.getVersion()
public boolean hasWriters()
hasWriters
in interface AbstractLuceneSearchEngine.WorkspaceSession
protected final void recordChange()
protected final void recordChanges(int numberOfChanges)
public final int getChangeCount()
getChangeCount
in interface AbstractLuceneSearchEngine.WorkspaceSession
AbstractLuceneSearchEngine.WorkspaceSession.getChangeCount()
public void commit()
commit
in interface AbstractLuceneSearchEngine.WorkspaceSession
AbstractLuceneSearchEngine.WorkspaceSession.commit()
public void rollback()
rollback
in interface AbstractLuceneSearchEngine.WorkspaceSession
AbstractLuceneSearchEngine.WorkspaceSession.rollback()
protected QueryResults.Statistics search(String fullTextSearchExpression, List<Object[]> results, int maxRows, int offset) throws org.apache.lucene.queryParser.ParseException, IOException
org.apache.lucene.queryParser.ParseException
IOException
protected Location readLocation(org.apache.lucene.document.Document doc)
protected void setOrReplaceProperties(Location location, Iterable<Property> properties) throws IOException
IOException
public AbstractLuceneSearchEngine.TupleCollector createTupleCollector(QueryResults.Columns columns)
AbstractLuceneSearchEngine.TupleCollector
instance that collects the results from the index(es).
createTupleCollector
in interface AbstractLuceneSearchEngine.WorkspaceSession
columns
- the column definitions; never null
AbstractLuceneSearchEngine.WorkspaceSession.createTupleCollector(org.modeshape.graph.query.QueryResults.Columns)
public Location getLocationForRoot() throws IOException
IOException
public org.apache.lucene.search.Query findAllNodesBelow(Path parentPath)
findAllNodesBelow
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findAllNodesBelow(Path parentPath, int maximumDepth)
public org.apache.lucene.search.Query findAllNodesAtOrBelow(Path parentPath)
findAllNodesAtOrBelow
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findChildNodes(Path parentPath)
findChildNodes
in interface AbstractLuceneSearchEngine.WorkspaceSession
parentPath
- the path of the parent node.
public org.apache.lucene.search.Query findNodeAt(Path path)
findNodeAt
in interface AbstractLuceneSearchEngine.WorkspaceSession
path
- the path of the node
public org.apache.lucene.search.Query findNodesLike(String fieldName, String likeExpression, boolean caseSensitive)
AbstractLuceneSearchEngine.WorkspaceSession
findNodesLike
in interface AbstractLuceneSearchEngine.WorkspaceSession
fieldName
- the name of the document field to searchlikeExpression
- the JCR like expressioncaseSensitive
- true if the evaluation should be performed in a case sensitive manner, or false otherwise
public org.apache.lucene.search.Query findNodesWith(Length propertyLength, Operator operator, Object value)
findNodesWith
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findNodesWith(PropertyValue propertyValue, Operator operator, Object value, boolean caseSensitive)
findNodesWith
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findNodesWith(ReferenceValue referenceValue, Operator operator, Object value)
findNodesWith
in interface AbstractLuceneSearchEngine.WorkspaceSession
AbstractLuceneSearchEngine.WorkspaceSession.findNodesWith(org.modeshape.graph.query.model.ReferenceValue,
org.modeshape.graph.query.model.Operator, java.lang.Object)
public org.apache.lucene.search.Query findNodesWithNumericRange(PropertyValue propertyValue, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper)
findNodesWithNumericRange
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findNodesWithNumericRange(NodeDepth depth, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper)
findNodesWithNumericRange
in interface AbstractLuceneSearchEngine.WorkspaceSession
protected org.apache.lucene.search.Query findNodesWithNumericRange(String field, Object lowerValue, Object upperValue, boolean includesLower, boolean includesUpper)
protected String likeExpresionForWildcardPath(String path)
public org.apache.lucene.search.Query findNodesWith(NodePath nodePath, Operator operator, Object value, boolean caseSensitive)
findNodesWith
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findNodesWith(NodeName nodeName, Operator operator, Object value, boolean caseSensitive)
findNodesWith
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findNodesWith(NodeLocalName nodeName, Operator operator, Object value, boolean caseSensitive)
findNodesWith
in interface AbstractLuceneSearchEngine.WorkspaceSession
public org.apache.lucene.search.Query findNodesWith(NodeDepth depthConstraint, Operator operator, Object value)
findNodesWith
in interface AbstractLuceneSearchEngine.WorkspaceSession
protected org.apache.lucene.search.Query createLocalNameQuery(String likeExpression, boolean caseSensitive)
protected org.apache.lucene.search.Query createSnsIndexQuery(String likeExpression)
likeExpression
- the expression that uses the JCR 2.0 LIKE representation, and which includes the leading '[' and
trailing ']' characters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |