Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface Searchable
extends Remote
Method Summary | |
void |
|
Document |
|
int | |
int[] | |
Explanation |
|
Explanation | |
int |
|
Query | |
TopDocs |
|
TopFieldDocs |
|
void |
|
TopDocs | |
TopFieldDocs | |
void |
|
public void close() throws IOException
Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects likeHits
.
public Document doc(int i) throws IOException
Expert: Returns the stored fields of documenti
. Called byHitCollector
implementations.
- See Also:
IndexReader.document(int)
public int docFreq(Term term) throws IOException
Expert: Returns the number of documents containingterm
. Called by search code to compute term weights.
- See Also:
IndexReader.docFreq(Term)
public int[] docFreqs(Term[] terms) throws IOException
Expert: For each term in the terms array, calculates the number of documents containingterm
. Returns an array with these document frequencies. Used to minimize number of remote calls.
public Explanation explain(Query query, int doc) throws IOException
Deprecated. use
Searcher.explain(Weight,int)
instead.
public Explanation explain(Weight weight, int doc) throws IOException
Expert: low-level implementation method Returns an Explanation that describes howdoc
scored againstweight
. This is intended to be used in developing Similarity implementations, and, for good performance, should not be displayed with every hit. Computing an explanation is as expensive as executing the query over the entire index. Applications should callSearcher.explain(Query,int)
.
public int maxDoc() throws IOException
Expert: Returns one greater than the largest possible document number. Called by search code to compute term weights.
- See Also:
IndexReader.maxDoc()
public Query rewrite(Query query) throws IOException
Expert: called to re-write queries into primitive queries.
public TopDocs search(Query query, Filter filter, int n) throws IOException
Deprecated. use
Searcher.search(Weight,Filter,int)
instead.Expert: Low-level search implementation.
public TopFieldDocs search(Query query, Filter filter, int n, Sort sort) throws IOException
Deprecated. use
Searcher.search(Weight,Filter,int,Sort)
instead.Expert: Low-level search implementation.
public void search(Query query, Filter filter, HitCollector results) throws IOException
Deprecated. use
Searcher.search(Weight,Filter,HitCollector)
instead.Expert: Low-level search implementation.
public TopDocs search(Weight weight, Filter filter, int n) throws IOException
Expert: Low-level search implementation. Finds the topn
hits forquery
, applyingfilter
if non-null. Called byHits
. Applications should usually callSearcher.search(Query)
orSearcher.search(Query,Filter)
instead.
public TopFieldDocs search(Weight weight, Filter filter, int n, Sort sort) throws IOException
Expert: Low-level search implementation with arbitrary sorting. Finds the topn
hits forquery
, applyingfilter
if non-null, and sorting the hits by the criteria insort
. Applications should usually callSearcher.search(Query,Filter,Sort)
instead.
public void search(Weight weight, Filter filter, HitCollector results) throws IOException
Lower-level search API.HitCollector.collect(int,float)
is called for every non-zero scoring document.
HitCollector-based access to remote indexes is discouraged. Applications should only use this if they need all of the matching documents. The high-level search API (Searcher.search(Query)
) is usually more efficient, as it skips non-high-scoring hits.
- Parameters:
weight
- to match documentsfilter
- if non-null, a bitset used to eliminate some documentsresults
- to receive hits