Class JackrabbitIndexSearcher
- java.lang.Object
-
- org.apache.lucene.search.Searcher
-
- org.apache.lucene.search.IndexSearcher
-
- org.apache.jackrabbit.core.query.lucene.JackrabbitIndexSearcher
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,EvaluationContext
,Searchable
public class JackrabbitIndexSearcher extends IndexSearcher implements EvaluationContext
JackrabbitIndexSearcher
implements an index searcher with jackrabbit specific optimizations.
-
-
Field Summary
-
Fields inherited from class org.apache.lucene.search.IndexSearcher
docStarts, subReaders, subSearchers
-
-
Constructor Summary
Constructors Constructor Description JackrabbitIndexSearcher(SessionImpl s, IndexReader r, ItemStateManager ism)
Creates a new jackrabbit index searcher.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
docFreq(Term term)
QueryHits
evaluate(Query query)
Evaluates the query and returns the hits that match the query.QueryHits
evaluate(Query query, Sort sort, long resultFetchHint)
Evaluates the query and returns the hits that match the query.MultiColumnQueryHits
execute(Query query, Sort sort, long resultFetchHint, Name selectorName)
Executes the query and returns the hits that match the query.ItemStateManager
getItemStateManager()
SessionImpl
getSession()
-
Methods inherited from class org.apache.lucene.search.IndexSearcher
close, createNormalizedWeight, doc, doc, explain, explain, gatherSubReaders, getIndexReader, getSimilarity, getSubReaders, maxDoc, rewrite, search, search, search, search, search, search, search, search, search, search, search, searchAfter, searchAfter, setDefaultFieldSortScoring, setSimilarity, toString
-
Methods inherited from class org.apache.lucene.search.Searcher
createWeight, docFreqs
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.core.query.lucene.constraint.EvaluationContext
getIndexReader
-
-
-
-
Constructor Detail
-
JackrabbitIndexSearcher
public JackrabbitIndexSearcher(SessionImpl s, IndexReader r, ItemStateManager ism)
Creates a new jackrabbit index searcher.- Parameters:
s
- the session that executes the query.r
- the index reader.ism
- the shared item state manager.
-
-
Method Detail
-
execute
public MultiColumnQueryHits execute(Query query, Sort sort, long resultFetchHint, Name selectorName) throws IOException
Executes the query and returns the hits that match the query.- Parameters:
query
- the query to execute.sort
- the sort criteria.resultFetchHint
- a hint on how many results should be fetched.selectorName
- the single selector name for the query hits.- Returns:
- the query hits.
- Throws:
IOException
- if an error occurs while executing the query.
-
evaluate
public QueryHits evaluate(Query query, Sort sort, long resultFetchHint) throws IOException
Evaluates the query and returns the hits that match the query.- Parameters:
query
- the query to execute.sort
- the sort criteria.resultFetchHint
- a hint on how many results should be fetched.- Returns:
- the query hits.
- Throws:
IOException
- if an error occurs while executing the query.
-
docFreq
public int docFreq(Term term) throws IOException
- Specified by:
docFreq
in interfaceSearchable
- Overrides:
docFreq
in classIndexSearcher
- Throws:
IOException
-
evaluate
public QueryHits evaluate(Query query) throws IOException
Evaluates the query and returns the hits that match the query.- Specified by:
evaluate
in interfaceEvaluationContext
- Parameters:
query
- the query to execute.- Returns:
- the query hits.
- Throws:
IOException
- if an error occurs while executing the query.
-
getSession
public SessionImpl getSession()
- Specified by:
getSession
in interfaceEvaluationContext
- Returns:
- session that executes the query.
-
getItemStateManager
public ItemStateManager getItemStateManager()
- Specified by:
getItemStateManager
in interfaceEvaluationContext
- Returns:
- the item state manager of the workspace.
-
-