Lucene.Net.Search.FieldComparator.SetBottom C# (CSharp) Method

SetBottom() public abstract method

Set the bottom slot, ie the "weakest" (sorted last) entry in the queue. When CompareBottom is called, you should compare against this slot. This will always be called before CompareBottom.
public abstract SetBottom ( int slot ) : void
slot int the currently weakest (sorted last) slot in the queue ///
return void
        public abstract void SetBottom(int slot);

Usage Example

Beispiel #1
0
            public override void  Collect(int doc)
            {
                ++totalHits;
                if (queueFull)
                {
                    if ((reverseMul * comparator.CompareBottom(doc)) <= 0)
                    {
                        // since docs are visited in doc Id order, if compare is 0, it means
                        // this document is largest than anything else in the queue, and
                        // therefore not competitive.
                        return;
                    }

                    // This hit is competitive - replace bottom element in queue & adjustTop
                    comparator.Copy(bottom.slot, doc);
                    UpdateBottom(doc);
                    comparator.SetBottom(bottom.slot);
                }
                else
                {
                    // Startup transient: queue hasn't gathered numHits yet
                    int slot = totalHits - 1;
                    // Copy hit into queue
                    comparator.Copy(slot, doc);
                    Add(slot, doc, System.Single.NaN);
                    if (queueFull)
                    {
                        comparator.SetBottom(bottom.slot);
                    }
                }
            }