| java.lang.Object org.apache.lucene.search.Searcher org.apache.lucene.search.IndexSearcher
IndexSearcher | public class IndexSearcher extends Searcher (Code) | | Implements search over a single IndexReader.
Applications usually need only call the inherited
IndexSearcher.search(Query) or
IndexSearcher.search(Query,Filter) 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.
|
Method Summary | |
public void | close() Note that the underlying IndexReader is not closed, if
IndexSearcher was constructed with IndexSearcher(IndexReader r). | public Document | doc(int i) | public Document | doc(int i, FieldSelector fieldSelector) | public int | docFreq(Term term) | public Explanation | explain(Weight weight, int doc) | public IndexReader | getIndexReader() Return the
IndexReader this searches. | public int | maxDoc() | public Query | rewrite(Query original) | public TopDocs | search(Weight weight, Filter filter, int nDocs) | public TopFieldDocs | search(Weight weight, Filter filter, int nDocs, Sort sort) | public void | search(Weight weight, Filter filter, HitCollector results) |
IndexSearcher | public IndexSearcher(IndexReader r)(Code) | | Creates a searcher searching the provided index.
|
close | public void close() throws IOException(Code) | | Note that the underlying IndexReader is not closed, if
IndexSearcher was constructed with IndexSearcher(IndexReader r).
If the IndexReader was supplied implicitly by specifying a directory, then
the IndexReader gets closed.
|
Methods inherited from org.apache.lucene.search.Searcher | abstract public void close() throws IOException(Code)(Java Doc) protected Weight createWeight(Query query) throws IOException(Code)(Java Doc) abstract public Document doc(int i) throws CorruptIndexException, IOException(Code)(Java Doc) abstract public int docFreq(Term term) throws IOException(Code)(Java Doc) public int[] docFreqs(Term[] terms) throws IOException(Code)(Java Doc) public Explanation explain(Query query, int doc) throws IOException(Code)(Java Doc) abstract public Explanation explain(Weight weight, int doc) throws IOException(Code)(Java Doc) public Similarity getSimilarity()(Code)(Java Doc) abstract public int maxDoc() throws IOException(Code)(Java Doc) abstract public Query rewrite(Query query) throws IOException(Code)(Java Doc) final public Hits search(Query query) throws IOException(Code)(Java Doc) public Hits search(Query query, Filter filter) throws IOException(Code)(Java Doc) public Hits search(Query query, Sort sort) throws IOException(Code)(Java Doc) public Hits search(Query query, Filter filter, Sort sort) throws IOException(Code)(Java Doc) public TopFieldDocs search(Query query, Filter filter, int n, Sort sort) throws IOException(Code)(Java Doc) public void search(Query query, HitCollector results) throws IOException(Code)(Java Doc) public void search(Query query, Filter filter, HitCollector results) throws IOException(Code)(Java Doc) public TopDocs search(Query query, Filter filter, int n) throws IOException(Code)(Java Doc) abstract public void search(Weight weight, Filter filter, HitCollector results) throws IOException(Code)(Java Doc) abstract public TopDocs search(Weight weight, Filter filter, int n) throws IOException(Code)(Java Doc) abstract public TopFieldDocs search(Weight weight, Filter filter, int n, Sort sort) throws IOException(Code)(Java Doc) public void setSimilarity(Similarity similarity)(Code)(Java Doc)
|
|
|