## org.apache.lucene.search
Class ParallelMultiSearcher

    java.lang.Object
      org.apache.lucene.search.Searcher
          org.apache.lucene.search.MultiSearcher
              org.apache.lucene.search.ParallelMultiSearcher

All Implemented Interfaces:
  Remote, Searchable

    public class ParallelMultiSearcher

extends MultiSearcher

Implements parallel search over a set of `Searchables`.

Applications usually need only call the inherited `Searcher.search(Query)` or `Searcher.search(Query,Filter)` methods.

Constructor Summary
`ParallelMultiSearcher(Searchable[] searchables)` Creates a searcher which searches searchables.

Method Summary
`int` `docFreq(Term term)` TODO: parallelize this one too
`Query` `rewrite(Query original)` Expert: called to re-write queries into primitive queries.
`void` `search(Weight weight, Filter filter, HitCollector results)` Lower-level search API.
`TopDocs` `search(Weight weight, Filter filter, int nDocs)` A search implementation which spans a new thread for each Searchable, waits for each search to complete and merge the results back together.
`TopFieldDocs` `search(Weight weight, Filter filter, int nDocs, Sort sort)` A search implementation allowing sorting which spans a new thread for each Searchable, waits for each search to complete and merges the results back together.

Methods inherited from class org.apache.lucene.search.MultiSearcher
`close, createWeight, doc, doc, explain, getSearchables, getStarts, maxDoc, subDoc, subSearcher`

Methods inherited from class org.apache.lucene.search.Searcher
`docFreqs, explain, getSimilarity, search, search, search, search, search, search, search, search, setSimilarity`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ParallelMultiSearcher

    public ParallelMultiSearcher(Searchable[] searchables)
                          throws IOException

  Creates a searcher which searches searchables.

  Throws:
    `IOException`

Method Detail

### docFreq

    public int docFreq(Term term)
                throws IOException

  TODO: parallelize this one too

  Specified by:
    `docFreq` in interface `Searchable`
  Overrides:
    `docFreq` in class `MultiSearcher`
  Throws:
    `IOException`
  See Also:
    `IndexReader.docFreq(Term)`

### search

    public TopDocs search(Weight weight,
                          Filter filter,
                          int nDocs)
                   throws IOException

  A search implementation which spans a new thread for each Searchable, waits for each search to complete and merge the results back together.

  Specified by:
    `search` in interface `Searchable`
  Overrides:
    `search` in class `MultiSearcher`
  Throws:
    `IOException`

### search

    public TopFieldDocs search(Weight weight,
                               Filter filter,
                               int nDocs,
                               Sort sort)
                        throws IOException

  A search implementation allowing sorting which spans a new thread for each Searchable, waits for each search to complete and merges the results back together.

  Specified by:
    `search` in interface `Searchable`
  Overrides:
    `search` in class `MultiSearcher`
  Throws:
    `IOException`

### search

    public void search(Weight weight,
                       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.

  Specified by:
    `search` in interface `Searchable`
  Overrides:
    `search` in class `MultiSearcher`
  Parameters:
    `weight` - to match documents
    `filter` - if non-null, a bitset used to eliminate some documents
    `results` - to receive hits
  Throws:
    `IOException`
  To Do:
    parallelize this one too

### rewrite

    public Query rewrite(Query original)
                  throws IOException

  Description copied from interface: `Searchable`
  Expert: called to re-write queries into primitive queries.

  Specified by:
    `rewrite` in interface `Searchable`
  Overrides:
    `rewrite` in class `MultiSearcher`
  Throws:
    `IOException`

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