C# Класс Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyReader

A TaxonomyReader which retrieves stored taxonomy information from a Directory.

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. @lucene.experimental

Наследование: TaxonomyReader, IDisposable
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
DirectoryTaxonomyReader System
InitTaxoArrays void

Открытые методы

Метод Описание
DirectoryTaxonomyReader ( Directory directory ) : System

Open for reading a taxonomy stored in a given Directory.

DirectoryTaxonomyReader ( DirectoryTaxonomyWriter taxoWriter ) : System

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

Dispose ( ) : void
GetOrdinal ( FacetLabel cp ) : int
GetPath ( int ordinal ) : FacetLabel
ToString ( int max ) : string

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

Защищенные методы

Метод Описание
DoClose ( ) : void
DoOpenIfChanged ( ) : TaxonomyReader

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 CacheSize, it will affect both reader instances.

OpenIndexReader ( Directory directory ) : DirectoryReader

Open the DirectoryReader from this Directory.

OpenIndexReader ( IndexWriter writer ) : DirectoryReader

Open the DirectoryReader from this IndexWriter.

Приватные методы

Метод Описание
DirectoryTaxonomyReader ( DirectoryReader indexReader, DirectoryTaxonomyWriter taxoWriter, IntClass>.LRUHashMap ordinalCache, FacetLabel>.LRUHashMap categoryCache, TaxonomyIndexArrays taxoArrays ) : System

Called only from DoOpenIfChanged(). If the taxonomy has been recreated, you should pass null as the caches and parent/children arrays.

InitTaxoArrays ( ) : void

Описание методов

DirectoryTaxonomyReader() публичный Метод

Open for reading a taxonomy stored in a given Directory.
if the Taxonomy is corrupt. if another error occurred.
public DirectoryTaxonomyReader ( Directory directory ) : System
directory System.IO.Directory The in which the taxonomy resides.
Результат System

DirectoryTaxonomyReader() публичный Метод

Opens a DirectoryTaxonomyReader over the given DirectoryTaxonomyWriter (for NRT).
public DirectoryTaxonomyReader ( DirectoryTaxonomyWriter taxoWriter ) : System
taxoWriter DirectoryTaxonomyWriter /// The from which to obtain newly /// added categories, in real-time.
Результат System

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

DoClose() защищенный Метод

protected DoClose ( ) : void
Результат void

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 CacheSize, it will affect both reader instances.

protected DoOpenIfChanged ( ) : TaxonomyReader
Результат TaxonomyReader

GetOrdinal() публичный Метод

public GetOrdinal ( FacetLabel cp ) : int
cp FacetLabel
Результат int

GetPath() публичный Метод

public GetPath ( int ordinal ) : FacetLabel
ordinal int
Результат FacetLabel

OpenIndexReader() защищенный Метод

Open the DirectoryReader from this Directory.
protected OpenIndexReader ( Directory directory ) : DirectoryReader
directory System.IO.Directory
Результат DirectoryReader

OpenIndexReader() защищенный Метод

Open the DirectoryReader from this IndexWriter.
protected OpenIndexReader ( IndexWriter writer ) : DirectoryReader
writer IndexWriter
Результат DirectoryReader

ToString() публичный Метод

Returns ordinal -> label mapping, up to the provided max ordinal or number of ordinals, whichever is smaller.
public ToString ( int max ) : string
max int
Результат string