Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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(Query query, Filter filter, HitCollector results)` Lower-level search API.
`TopDocs` | `search(Query query, 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(Query query, 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, doc, explain, getStarts, maxDoc, searcherIndex, subDoc, subSearcher`

Methods inherited from class org.apache.lucene.search.Searcher
`getSimilarity, 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.

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`

### search

    public TopDocs search(Query query,
                          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(Query query,
                               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(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.

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

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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