Show / Hide Table of Contents

    Class DirectoryTaxonomyReader

    A TaxonomyReader which retrieves stored taxonomy information from a .

    Reading from the on-disk index on every method call is too slow, so this implementation employs caching: Some methods cache recent requests and their results, while other methods prefetch all the data into memory and then provide answers directly from in-memory tables. See the documentation of individual methods for comments on their performance.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    TaxonomyReader
    DirectoryTaxonomyReader
    Inherited Members
    TaxonomyReader.ROOT_ORDINAL
    TaxonomyReader.INVALID_ORDINAL
    TaxonomyReader.OpenIfChanged<T>(T)
    TaxonomyReader.EnsureOpen()
    TaxonomyReader.Dispose()
    TaxonomyReader.Dispose(Boolean)
    TaxonomyReader.DecRef()
    TaxonomyReader.GetChildren(Int32)
    TaxonomyReader.GetOrdinal(String, String[])
    TaxonomyReader.RefCount
    TaxonomyReader.IncRef()
    TaxonomyReader.TryIncRef()
    Namespace: Lucene.Net.Facet.Taxonomy.Directory
    Assembly: Lucene.Net.Facet.dll
    Syntax
    public class DirectoryTaxonomyReader : TaxonomyReader

    Constructors

    | Improve this Doc View Source

    DirectoryTaxonomyReader(DirectoryTaxonomyWriter)

    Opens a DirectoryTaxonomyReader over the given DirectoryTaxonomyWriter (for NRT).

    Declaration
    public DirectoryTaxonomyReader(DirectoryTaxonomyWriter taxoWriter)
    Parameters
    Type Name Description
    DirectoryTaxonomyWriter taxoWriter

    The DirectoryTaxonomyWriter from which to obtain newly added categories, in real-time.

    | Improve this Doc View Source

    DirectoryTaxonomyReader(Store.Directory)

    Open for reading a taxonomy stored in a given .

    Declaration
    public DirectoryTaxonomyReader(Store.Directory directory)
    Parameters
    Type Name Description
    Store.Directory directory

    The in which the taxonomy resides.

    Properties

    | Improve this Doc View Source

    CommitUserData

    Declaration
    public override IDictionary<string, string> CommitUserData { get; }
    Property Value
    Type Description
    IDictionary<System.String, System.String>
    Overrides
    TaxonomyReader.CommitUserData
    | Improve this Doc View Source

    Count

    Declaration
    public override int Count { get; }
    Property Value
    Type Description
    System.Int32
    Overrides
    TaxonomyReader.Count
    | Improve this Doc View Source

    ParallelTaxonomyArrays

    Declaration
    public override ParallelTaxonomyArrays ParallelTaxonomyArrays { get; }
    Property Value
    Type Description
    ParallelTaxonomyArrays
    Overrides
    TaxonomyReader.ParallelTaxonomyArrays

    Methods

    | Improve this Doc View Source

    DoClose()

    Declaration
    protected override void DoClose()
    Overrides
    TaxonomyReader.DoClose()
    | Improve this Doc View Source

    DoOpenIfChanged()

    Implements the opening of a new DirectoryTaxonomyReader instance if the taxonomy has changed.

    NOTE: the returned DirectoryTaxonomyReader shares the ordinal and category caches with this reader. This is not expected to cause any issues, unless the two instances continue to live. The reader guarantees that the two instances cannot affect each other in terms of correctness of the caches, however if the size of the cache is changed through SetCacheSize(Int32), it will affect both reader instances.

    Declaration
    protected override TaxonomyReader DoOpenIfChanged()
    Returns
    Type Description
    TaxonomyReader
    Overrides
    TaxonomyReader.DoOpenIfChanged()
    | Improve this Doc View Source

    GetOrdinal(FacetLabel)

    Declaration
    public override int GetOrdinal(FacetLabel cp)
    Parameters
    Type Name Description
    FacetLabel cp
    Returns
    Type Description
    System.Int32
    Overrides
    TaxonomyReader.GetOrdinal(FacetLabel)
    | Improve this Doc View Source

    GetPath(Int32)

    Declaration
    public override FacetLabel GetPath(int ordinal)
    Parameters
    Type Name Description
    System.Int32 ordinal
    Returns
    Type Description
    FacetLabel
    Overrides
    TaxonomyReader.GetPath(Int32)
    | Improve this Doc View Source

    OpenIndexReader(Index.IndexWriter)

    Open the from this .

    Declaration
    protected virtual Index.DirectoryReader OpenIndexReader(Index.IndexWriter writer)
    Parameters
    Type Name Description
    Index.IndexWriter writer
    Returns
    Type Description
    Index.DirectoryReader
    | Improve this Doc View Source

    OpenIndexReader(Store.Directory)

    Open the from this .

    Declaration
    protected virtual Index.DirectoryReader OpenIndexReader(Store.Directory directory)
    Parameters
    Type Name Description
    Store.Directory directory
    Returns
    Type Description
    Index.DirectoryReader
    | Improve this Doc View Source

    SetCacheSize(Int32)

    SetCacheSize(Int32) controls the maximum allowed size of each of the caches used by GetPath(Int32) and GetOrdinal(FacetLabel).

    Currently, if the given size is smaller than the current size of a cache, it will not shrink, and rather we be limited to its current size.

    Declaration
    public virtual void SetCacheSize(int size)
    Parameters
    Type Name Description
    System.Int32 size

    the new maximum cache size, in number of entries.

    | Improve this Doc View Source

    ToString(Int32)

    Returns ordinal -> label mapping, up to the provided max ordinal or number of ordinals, whichever is smaller.

    Declaration
    public virtual string ToString(int max)
    Parameters
    Type Name Description
    System.Int32 max
    Returns
    Type Description
    System.String
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)