Class SearcherFactory
Factory class used by SearcherManager to create new IndexSearchers. The default implementation just creates an IndexSearcher with no custom behavior:
public IndexSearcher NewSearcher(IndexReader r)
{
return new IndexSearcher(r);
}
You can pass your own factory instead if you want custom behavior, such as:
- Setting a custom scoring model: Similarity
- Parallel per-segment search: IndexSearcher(IndexReader, TaskScheduler)
- Return custom subclasses of IndexSearcher (for example that implement distributed scoring)
- Run queries to warm your IndexSearcher before it is used. Note: when using near-realtime search you may want to also set MergedSegmentWarmer to warm newly merged segments in the background, outside of the reopen path.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Inheritance
System.Object
SearcherFactory
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Search
Assembly: Lucene.Net.dll
Syntax
public class SearcherFactory
Methods
| Improve this Doc View SourceNewSearcher(IndexReader)
Returns a new IndexSearcher over the given reader.
Declaration
public virtual IndexSearcher NewSearcher(IndexReader reader)
Parameters
Type | Name | Description |
---|---|---|
IndexReader | reader |
Returns
Type | Description |
---|---|
IndexSearcher |