Package 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:
Closeable
,AutoCloseable
,Searchable
@Deprecated public class ParallelMultiSearcher extends MultiSearcher
Deprecated.Please pass an ExecutorService toIndexSearcher
, instead.Implements parallel search over a set ofSearchables
.Applications usually need only call the inherited
Searcher.search(Query,int)
orSearcher.search(Query,Filter,int)
methods.
-
-
Constructor Summary
Constructors Constructor Description ParallelMultiSearcher(ExecutorService executor, Searchable... searchables)
Deprecated.Creates aSearchable
which searches searchables with the specified ExecutorService.ParallelMultiSearcher(Searchable... searchables)
Deprecated.Creates aSearchable
which searches searchables with the default executor service (a cached thread pool).
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
close()
Deprecated.Frees resources associated with this Searcher.int
docFreq(Term term)
Deprecated.Executes eachSearchable
'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)
Deprecated.A search implementation which executes eachSearchable
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)
Deprecated.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)
Deprecated.Lower-level search API.-
Methods inherited from class org.apache.lucene.search.MultiSearcher
createNormalizedWeight, doc, doc, explain, getSearchables, getStarts, maxDoc, rewrite, subDoc, subSearcher
-
Methods inherited from class org.apache.lucene.search.Searcher
createWeight, docFreqs, explain, getSimilarity, search, search, search, search, search, search, setSimilarity
-
-
-
-
Constructor Detail
-
ParallelMultiSearcher
public ParallelMultiSearcher(Searchable... searchables) throws IOException
Deprecated.Creates aSearchable
which searches searchables with the default executor service (a cached thread pool).- Throws:
IOException
-
ParallelMultiSearcher
public ParallelMultiSearcher(ExecutorService executor, Searchable... searchables) throws IOException
Deprecated.Creates aSearchable
which searches searchables with the specified ExecutorService.- Throws:
IOException
-
-
Method Detail
-
docFreq
public int docFreq(Term term) throws IOException
Deprecated.Executes eachSearchable
's docFreq() in its own thread and waits for each search to complete and merge the results back together.- Specified by:
docFreq
in interfaceSearchable
- Overrides:
docFreq
in classMultiSearcher
- Throws:
IOException
- See Also:
IndexReader.docFreq(Term)
-
search
public TopDocs search(Weight weight, Filter filter, int nDocs) throws IOException
Deprecated.A search implementation which executes eachSearchable
in its own thread and waits for each search to complete and merge the results back together.- Specified by:
search
in interfaceSearchable
- Overrides:
search
in classMultiSearcher
- Throws:
IOException
-
search
public TopFieldDocs search(Weight weight, Filter filter, int nDocs, Sort sort) throws IOException
Deprecated.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 interfaceSearchable
- Overrides:
search
in classMultiSearcher
- Throws:
IOException
-
search
public void search(Weight weight, Filter filter, Collector collector) throws IOException
Deprecated.Lower-level search API.Collector.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 (
Searcher.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.- Specified by:
search
in interfaceSearchable
- Overrides:
search
in classMultiSearcher
- Parameters:
weight
- to match documentsfilter
- if non-null, a bitset used to eliminate some documentscollector
- to receive hits- Throws:
IOException
-
close
public void close() throws IOException
Deprecated.Description copied from interface:Searchable
Frees resources associated with this Searcher. Be careful not to call this method while you are still using objects that reference this Searchable.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceSearchable
- Overrides:
close
in classMultiSearcher
- Throws:
IOException
-
-