Class CompactLabelToOrdinal
This is a very efficient Label
Since the Lucene.
This data structure grows by adding a new HashArray whenever the number of
collisions in the CollisionGetMaxOrdinal().
Growing also includes reinserting all colliding
labels into the Lucene.
For setting the Lucene.
This data structure has a much lower memory footprint (~30%) compared to a Java HashMap<String, Integer>. It also only uses a small fraction of objects a HashMap would use, thus limiting the GC overhead. Ingestion speed was also ~50% faster compared to a HashMap for 3M unique labels.
Inherited Members
Namespace: Lucene.Net.Facet.Taxonomy.WriterCache
Assembly: Lucene.Net.Facet.dll
Syntax
public class CompactLabelToOrdinal : LabelToOrdinal
Constructors
| Improve this Doc View SourceCompactLabelToOrdinal(Int32, Single, Int32)
Sole constructor.
Declaration
public CompactLabelToOrdinal(int initialCapacity, float loadFactor, int numHashArrays)
Parameters
Type | Name | Description |
---|---|---|
System. |
initialCapacity | |
System. |
loadFactor | |
System. |
numHashArrays |
Fields
| Improve this Doc View SourceDefaultLoadFactor
Default maximum load factor.
Declaration
public const float DefaultLoadFactor = 0.15F
Field Value
Type | Description |
---|---|
System. |
TERMINATOR_CHAR
Declaration
public const char TERMINATOR_CHAR = '\uffff'
Field Value
Type | Description |
---|---|
System. |
Properties
| Improve this Doc View SourceSizeOfMap
How many labels.
Declaration
public virtual int SizeOfMap { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceAddLabel(FacetLabel, Int32)
Declaration
public override void AddLabel(FacetLabel label, int ordinal)
Parameters
Type | Name | Description |
---|---|---|
Facet |
label | |
System. |
ordinal |
Overrides
| Improve this Doc View SourceGetOrdinal(FacetLabel)
Declaration
public override int GetOrdinal(FacetLabel label)
Parameters
Type | Name | Description |
---|---|---|
Facet |
label |
Returns
Type | Description |
---|---|
System. |