Lucene.Net.Facet.Taxonomy.WriterCache.CompactLabelToOrdinal.AddLabel C# (CSharp) Method

AddLabel() private method

private AddLabel ( HashArray a, FacetLabel label, int hash, int ordinal ) : bool
a HashArray
label FacetLabel
hash int
ordinal int
return bool
        private bool AddLabel(HashArray a, FacetLabel label, int hash, int ordinal)
        {
            int index = CompactLabelToOrdinal.IndexFor(hash, a.offsets.Length);
            int offset = a.offsets[index];

            if (offset == 0)
            {
                a.offsets[index] = this.labelRepository.Length;
                CategoryPathUtils.Serialize(label, labelRepository);
                a.cids[index] = ordinal;
                return true;
            }

            return false;
        }

Same methods

CompactLabelToOrdinal::AddLabel ( FacetLabel label, int ordinal ) : void

Usage Example

 public virtual bool Put(FacetLabel categoryPath, int ordinal)
 {
     @lock.AcquireWriterLock(LockTimeOut);
     try
     {
         cache.AddLabel(categoryPath, ordinal);
         // Tell the caller we didn't clear part of the cache, so it doesn't
         // have to flush its on-disk index now
         return(false);
     }
     finally
     {
         @lock.ReleaseWriterLock();
     }
 }
All Usage Examples Of Lucene.Net.Facet.Taxonomy.WriterCache.CompactLabelToOrdinal::AddLabel