Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ReferenceManagerExtensions

    Inheritance
    System.Object
    ReferenceManagerExtensions
    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 static class ReferenceManagerExtensions

    Methods

    | Improve this Doc View Source

    GetContext<T>(ReferenceManager<T>)

    Obtain the current reference.

    Like Acquire(), but intended for use in a using block so calling Release(G) happens implicitly. For example:

    var searcherManager = new SearcherManager(indexWriter, true, null);
    using (var context = searcherManager.GetContext())
    {
        IndexSearcher searcher = context.Reference;
    
        // use searcher...
    }
    Declaration
    public static ReferenceContext<T> GetContext<T>(this ReferenceManager<T> referenceManager)
        where T : class
    Parameters
    Type Name Description
    ReferenceManager<T> referenceManager

    this ReferenceManager<G>

    Returns
    Type Description
    ReferenceContext<T>

    A ReferenceContext<T> instance that holds the Reference and ensures it is released properly when Dispose() is called.

    Type Parameters
    Name Description
    T

    The reference type

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 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.