C# Class 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

Inheritance: TaxonomyReader, IDisposable
Afficher le fichier Open project: apache/lucenenet Class Usage Examples

Private Properties

Свойство Type Description
DirectoryTaxonomyReader System
InitTaxoArrays void

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

DirectoryTaxonomyReader() public méthode

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.
Résultat System

DirectoryTaxonomyReader() public méthode

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.
Résultat System

Dispose() public méthode

public Dispose ( ) : void
Résultat void

DoClose() protected méthode

protected DoClose ( ) : void
Résultat void

DoOpenIfChanged() protected méthode

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
Résultat TaxonomyReader

GetOrdinal() public méthode

public GetOrdinal ( FacetLabel cp ) : int
cp FacetLabel
Résultat int

GetPath() public méthode

public GetPath ( int ordinal ) : FacetLabel
ordinal int
Résultat FacetLabel

OpenIndexReader() protected méthode

Open the DirectoryReader from this Directory.
protected OpenIndexReader ( Directory directory ) : DirectoryReader
directory System.IO.Directory
Résultat DirectoryReader

OpenIndexReader() protected méthode

Open the DirectoryReader from this IndexWriter.
protected OpenIndexReader ( IndexWriter writer ) : DirectoryReader
writer IndexWriter
Résultat DirectoryReader

ToString() public méthode

Returns ordinal -> label mapping, up to the provided max ordinal or number of ordinals, whichever is smaller.
public ToString ( int max ) : string
max int
Résultat string