public class

ParallelMultiSearcher

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

Class Overview

Implements parallel search over a set of Searchables.

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

Summary

Public Constructors
ParallelMultiSearcher(Searchable... searchables)
Creates a Searchable which searches searchables.
Public Methods
void close()
Frees resources associated with this Searcher.
int docFreq(Term term)
Executes each Searchable's docFreq() in its own thread and waits for each search to complete and merge the results back together.
TopDocs search(Weight weight, Filter filter, int nDocs)
A search implementation which executes each Searchable in its own thread and 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.
void search(Weight weight, Filter filter, Collector collector)
Lower-level search API.
[Expand]
Inherited Methods
From class org.apache.lucene.search.MultiSearcher
From class org.apache.lucene.search.Searcher
From class java.lang.Object
From interface java.io.Closeable
From interface org.apache.lucene.search.Searchable

Public Constructors

public ParallelMultiSearcher (Searchable... searchables)

Creates a Searchable which searches searchables.

Throws
IOException

Public Methods

public void close ()

Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects that reference this Searchable.

Throws
IOException

public int docFreq (Term term)

Executes each Searchable's docFreq() in its own thread and waits for each search to complete and merge the results back together.

Throws
IOException

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

A search implementation which executes each Searchable in its own thread and waits for each search to complete and merge the results back together.

Throws
IOException

public 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.

Throws
IOException

public void search (Weight weight, Filter filter, Collector collector)

Lower-level search API.

collect(int) is called for every matching document.

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

This method cannot be parallelized, because Collector supports no concurrent access.

Parameters
weight to match documents
filter if non-null, a bitset used to eliminate some documents
collector to receive hits
Throws
IOException