Interface DirectoryTaxonomyWriter.IOrdinalMap
Mapping from old ordinal to new ordinals, used when merging indexes wit separate taxonomies.
AddMapping(Int32, Int32) merges one or more taxonomies into the given taxonomy (this). An DirectoryTaxonomyWriter.IOrdinalMap is filled for each of the added taxonomies, containing the new ordinal (in the merged taxonomy) of each of the categories in the old taxonomy.
There exist two implementations of DirectoryTaxonomyWriter.IOrdinalMap: DirectoryTaxonomyWriter.MemoryOrdinalMap and DirectoryTaxonomyWriter.DiskOrdinalMap. As their names suggest, the former keeps the map in memory and the latter in a temporary disk file. Because these maps will later be needed one by one (to remap the counting lists), not all at the same time, it is recommended to put the first taxonomy's map in memory, and all the rest on disk (later to be automatically read into memory one by one, when needed).
Assembly: DistributedLucene.Net.Facet.dll
Syntax
public interface IOrdinalMap
Methods
Name | Description |
---|---|
AddDone() | Call AddDone() to say that all AddMapping(Int32, Int32) have been done. In some implementations this might free some resources. |
AddMapping(Int32, Int32) | Record a mapping. |
GetMap() | Return the map from the taxonomy's original (consecutive) ordinals to the new taxonomy's ordinals. If the map has to be read from disk and ordered appropriately, it is done when getMap() is called. getMap() should only be called once, and only when the map is actually needed. Calling it will also free all resources that the map might be holding (such as temporary disk space), other than the returned int[]. |
SetSize(Int32) | Set the size of the map. This MUST be called before AddMapping(Int32, Int32).
It is assumed (but not verified) that AddMapping(Int32, Int32) will then be
called exactly 'size' times, with different |