org.apache.lucene.search
public class IndexSearcher extends Searcher
Applications usually need only call the inherited IndexSearcher or IndexSearcher methods. For performance reasons it is recommended to open only one IndexSearcher and use it for all of your searches.
Note that you can only access Hits from an IndexSearcher as long as it is not yet closed, otherwise an IOException will be thrown.
Constructor Summary | |
---|---|
IndexSearcher(String path) Creates a searcher searching the index in the named directory. | |
IndexSearcher(Directory directory) Creates a searcher searching the index in the provided directory. | |
IndexSearcher(IndexReader r) Creates a searcher searching the provided index. |
Method Summary | |
---|---|
void | close()
Note that the underlying IndexReader is not closed, if
IndexSearcher was constructed with IndexSearcher(IndexReader r).
|
Document | doc(int i) |
int | docFreq(Term term) |
Explanation | explain(Weight weight, int doc) |
IndexReader | getIndexReader() Return the IndexReader this searches. |
int | maxDoc() |
Query | rewrite(Query original) |
TopDocs | search(Weight weight, Filter filter, int nDocs) |
TopFieldDocs | search(Weight weight, Filter filter, int nDocs, Sort sort) |
void | search(Weight weight, Filter filter, HitCollector results) |