Lucene.Net.Index.BufferedUpdates.AddTerm C# (CSharp) Метод

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

public AddTerm ( Lucene.Net.Index.Term term, int docIDUpto ) : void
term Lucene.Net.Index.Term
docIDUpto int
Результат void
        public virtual void AddTerm(Term term, int docIDUpto)
        {
            int? current;
            Terms.TryGetValue(term, out current);
            if (current != null && docIDUpto < current)
            {
                // Only record the new number if it's greater than the
                // current one.  this is important because if multiple
                // threads are replacing the same doc at nearly the
                // same time, it's possible that one thread that got a
                // higher docID is scheduled before the other
                // threads.  If we blindly replace than we can
                // incorrectly get both docs indexed.
                return;
            }

            Terms[term] = Convert.ToInt32(docIDUpto);
            // note that if current != null then it means there's already a buffered
            // delete on that term, therefore we seem to over-count. this over-counting
            // is done to respect IndexWriterConfig.setMaxBufferedDeleteTerms.
            NumTermDeletes.IncrementAndGet();
            if (current == null)
            {
                BytesUsed.AddAndGet(BYTES_PER_DEL_TERM + term.Bytes_Renamed.Length + (RamUsageEstimator.NUM_BYTES_CHAR * term.Field().Length));
            }
        }

Usage Example

 internal override void Apply(BufferedUpdates bufferedUpdates, int docIDUpto)
 {
     foreach (Term term in (Term[])item)
     {
         bufferedUpdates.AddTerm(term, docIDUpto);
     }
 }
All Usage Examples Of Lucene.Net.Index.BufferedUpdates::AddTerm