public class SearcherFactory extends Object
SearcherManager
to
create new IndexSearchers. The default implementation just creates
an IndexSearcher with no custom behavior:
public IndexSearcher newSearcher(IndexReader r) throws IOException { return new IndexSearcher(r); }You can pass your own factory instead if you want custom behavior, such as:
IndexSearcher.setSimilarity(Similarity)
IndexSearcher.IndexSearcher(IndexReader, ExecutorService)
IndexWriterConfig.setMergedSegmentWarmer(IndexWriter.IndexReaderWarmer)
to warm
newly merged segments in the background, outside of the reopen path.
Constructor and Description |
---|
SearcherFactory() |
Modifier and Type | Method and Description |
---|---|
IndexSearcher |
newSearcher(IndexReader reader)
Returns a new IndexSearcher over the given reader.
|
public IndexSearcher newSearcher(IndexReader reader) throws IOException
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.