org.jboss.dna.search.lucene
Class LuceneSearchSession

java.lang.Object
  extended by org.jboss.dna.search.lucene.LuceneSearchSession

@NotThreadSafe
public class LuceneSearchSession
extends Object

The AbstractLuceneSearchEngine.WorkspaceSession implementation for the LuceneSearchEngine.


Method Summary
 void commit()
          Subclasses should implement this method to commit and save any work that has been done with this processor.
 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 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 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)
           
 int getChangeCount()
          Get the number of changes that have been made to the workspace using this session.
 org.apache.lucene.search.IndexSearcher getContentSearcher()
           
 Location getLocationForRoot()
           
 LuceneSearchWorkspace getWorkspace()
           
 String getWorkspaceName()
          
 boolean hasWriters()
           
 void rollback()
          Subclasses should implement this method to throw away any work that has been done with this processor.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getWorkspaceName

public String getWorkspaceName()

See Also:
AbstractLuceneSearchEngine.WorkspaceSession.getWorkspaceName()

getWorkspace

public LuceneSearchWorkspace getWorkspace()
Returns:
workspace

getContentSearcher

public org.apache.lucene.search.IndexSearcher getContentSearcher()
                                                          throws IOException
Throws:
IOException

hasWriters

public boolean hasWriters()

getChangeCount

public final int getChangeCount()
Get the number of changes that have been made to the workspace using this session.

Returns:
the number of changes; never negative
See Also:
AbstractLuceneSearchEngine.WorkspaceSession.getChangeCount()

commit

public void commit()
Subclasses should implement this method to commit and save any work that has been done with this processor.

See Also:
AbstractLuceneSearchEngine.WorkspaceSession.commit()

rollback

public void rollback()
Subclasses should implement this method to throw away any work that has been done with this processor.

See Also:
AbstractLuceneSearchEngine.WorkspaceSession.rollback()

createTupleCollector

public AbstractLuceneSearchEngine.TupleCollector createTupleCollector(QueryResults.Columns columns)
Create a AbstractLuceneSearchEngine.TupleCollector instance that collects the results from the index(es).

Parameters:
columns - the column definitions; never null
Returns:
the collector; never null
See Also:
AbstractLuceneSearchEngine.WorkspaceSession.createTupleCollector(org.jboss.dna.graph.query.QueryResults.Columns)

getLocationForRoot

public Location getLocationForRoot()
                            throws IOException
Throws:
IOException

findAllNodesBelow

public org.apache.lucene.search.Query findAllNodesBelow(Path parentPath)

findAllNodesAtOrBelow

public org.apache.lucene.search.Query findAllNodesAtOrBelow(Path parentPath)

findChildNodes

public 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.

Parameters:
parentPath - the path of the parent node.
Returns:
the query; never null

findNodeAt

public 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.

Parameters:
path - the path of the node
Returns:
the query; never null

findNodesLike

public 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.

Parameters:
fieldName - the name of the document field to search
likeExpression - the JCR like expression
caseSensitive - true if the evaluation should be performed in a case sensitive manner, or false otherwise
Returns:
the query; never null

findNodesWith

public org.apache.lucene.search.Query findNodesWith(Length propertyLength,
                                                    Operator operator,
                                                    Object value)

findNodesWith

public org.apache.lucene.search.Query findNodesWith(PropertyValue propertyValue,
                                                    Operator operator,
                                                    Object value,
                                                    boolean caseSensitive)

findNodesWithNumericRange

public org.apache.lucene.search.Query findNodesWithNumericRange(PropertyValue propertyValue,
                                                                Object lowerValue,
                                                                Object upperValue,
                                                                boolean includesLower,
                                                                boolean includesUpper)

findNodesWithNumericRange

public org.apache.lucene.search.Query findNodesWithNumericRange(NodeDepth depth,
                                                                Object lowerValue,
                                                                Object upperValue,
                                                                boolean includesLower,
                                                                boolean includesUpper)

findNodesWith

public org.apache.lucene.search.Query findNodesWith(NodePath nodePath,
                                                    Operator operator,
                                                    Object value,
                                                    boolean caseSensitive)

findNodesWith

public org.apache.lucene.search.Query findNodesWith(NodeName nodeName,
                                                    Operator operator,
                                                    Object value,
                                                    boolean caseSensitive)

findNodesWith

public org.apache.lucene.search.Query findNodesWith(NodeLocalName nodeName,
                                                    Operator operator,
                                                    Object value,
                                                    boolean caseSensitive)

findNodesWith

public org.apache.lucene.search.Query findNodesWith(NodeDepth depthConstraint,
                                                    Operator operator,
                                                    Object value)


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.