org.apache.lucene.search
Class MultiSearcher

java.lang.Object
  |
  +--org.apache.lucene.search.Searcher
        |
        +--org.apache.lucene.search.MultiSearcher

public final class MultiSearcher
extends Searcher

Implements search over a set of Searchers.


Constructor Summary
MultiSearcher(Searcher[] searchers)
          Creates a searcher which searches searchers.
 
Method Summary
 void close()
          Frees resources associated with this Searcher.
 Document doc(int n)
          For use by HitCollector implementations.
 void search(Query query, Filter filter, HitCollector results)
          Lower-level search API.
 int searcherIndex(int n)
          For use by HitCollector implementations to identify the index of the sub-searcher that a particular hit came from.
 
Methods inherited from class org.apache.lucene.search.Searcher
search, search, search
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiSearcher

public MultiSearcher(Searcher[] searchers)
              throws IOException
Creates a searcher which searches searchers.
Method Detail

close

public final void close()
                 throws IOException
Frees resources associated with this Searcher.
Overrides:
close in class Searcher

doc

public final Document doc(int n)
                   throws IOException
For use by HitCollector implementations.
Overrides:
doc in class Searcher

searcherIndex

public final int searcherIndex(int n)
For use by HitCollector implementations to identify the index of the sub-searcher that a particular hit came from.

search

public final 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 (Searcher.search(Query)) is usually more efficient, as it skips non-high-scoring hits.

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


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