Fork me on GitHub
  • API

    Show / Hide Table of Contents

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

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    SearcherFactory
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class SearcherFactory

    Methods

    NewSearcher(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
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.