| java.lang.Object org.apache.lucene.search.Searcher
All known Subclasses: org.apache.lucene.search.IndexSearcher, org.apache.lucene.search.MultiSearcher,
Searcher | abstract public class Searcher implements Searchable(Code) | | An abstract base class for search implementations.
Implements the main search methods.
Note that you can only access Hits from a Searcher as long as it is
not yet closed, otherwise an IOException will be thrown.
|
Method Summary | |
abstract public void | close() | protected Weight | createWeight(Query query) | abstract public Document | doc(int i) | abstract public int | docFreq(Term term) | public int[] | docFreqs(Term[] terms) | public Explanation | explain(Query query, int doc) Returns an Explanation that describes how doc scored against
query . | abstract public Explanation | explain(Weight weight, int doc) | public Similarity | getSimilarity() Expert: Return the Similarity implementation used by this Searcher. | abstract public int | maxDoc() | abstract public Query | rewrite(Query query) | final public Hits | search(Query query) Returns the documents matching query . | public Hits | search(Query query, Filter filter) Returns the documents matching query and
filter . | public Hits | search(Query query, Sort sort) Returns documents matching query sorted by
sort . | public Hits | search(Query query, Filter filter, Sort sort) Returns documents matching query and filter ,
sorted by sort . | public TopFieldDocs | search(Query query, Filter filter, int n, Sort sort) Expert: Low-level search implementation with arbitrary sorting. | public void | search(Query query, HitCollector results) Lower-level search API.
HitCollector.collect(intfloat) is called for every non-zero
scoring document.
Applications should only use this if they need all of the
matching documents. | public void | search(Query query, Filter filter, HitCollector results) Lower-level search API.
HitCollector.collect(intfloat) 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. | public TopDocs | search(Query query, Filter filter, int n) Expert: Low-level search implementation. | abstract public void | search(Weight weight, Filter filter, HitCollector results) | abstract public TopDocs | search(Weight weight, Filter filter, int n) | abstract public TopFieldDocs | search(Weight weight, Filter filter, int n, Sort sort) | public void | setSimilarity(Similarity similarity) Expert: Set the Similarity implementation used by this Searcher. |
explain | public Explanation explain(Query query, int doc) throws IOException(Code) | | Returns an Explanation that describes how doc scored against
query .
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.
|
search | public void search(Query query, Filter filter, HitCollector results) throws IOException(Code) | | Lower-level search API.
HitCollector.collect(intfloat) 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: query - to match documents Parameters: filter - if non-null, a bitset used to eliminate some documents Parameters: results - to receive hits throws: BooleanQuery.TooManyClauses - |
|
|