org.apache.lucene.search
Class Searcher

java.lang.Object
  |
  +--org.apache.lucene.search.Searcher
Direct Known Subclasses:
IndexSearcher, MultiSearcher

public abstract class Searcher
extends Object

The abstract base class for search implementations.

Subclasses implement search over a single index, over multiple indices, and over indices on remote servers.


Constructor Summary
Searcher()
           
 
Method Summary
abstract  void close()
          Frees resources associated with this Searcher.
abstract  Document doc(int i)
          For use by HitCollector implementations.
 Hits search(Query query)
          Returns the documents matching query.
 Hits search(Query query, Filter filter)
          Returns the documents matching query and filter.
abstract  void search(Query query, Filter filter, HitCollector results)
          Lower-level search API.
 void search(Query query, HitCollector results)
          Lower-level search API.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Searcher

public Searcher()
Method Detail

search

public final Hits search(Query query)
                  throws IOException
Returns the documents matching query.

search

public Hits search(Query query,
                   Filter filter)
            throws IOException
Returns the documents matching query and filter.

search

public void search(Query query,
                   HitCollector results)
            throws IOException
Lower-level search API.

HitCollector.collect(int,float) is called for every non-zero scoring document.

Applications should only use this if they need all of the matching documents. The high-level search API (search(Query)) is usually more efficient, as it skips non-high-scoring hits.


search

public abstract void search(Query query,
                            Filter filter,
                            HitCollector results)
                     throws IOException
Lower-level search API.

HitCollector.collect(int,float) is called for every non-zero scoring document.

Applications should only use this if they need all of the matching documents. The high-level search API (search(Query)) is usually more efficient, as it skips non-high-scoring hits.

Parameters:
query - to match documents
filter - if non-null, a bitset used to eliminate some documents
results - to receive hits

close

public abstract void close()
                    throws IOException
Frees resources associated with this Searcher.

doc

public abstract Document doc(int i)
                      throws IOException
For use by HitCollector implementations.


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.