Lucene.Net.Search.DisjunctionSumScorer.Advance C# (CSharp) Method

Advance() public method

Advances to the first match beyond the current whose document number is greater than or equal to a given target.
The implementation uses the skipTo() method on the subscorers.
public Advance ( int target ) : int
target int The target document number. ///
return int
		public override int Advance(int target)
		{
			if (scorerDocQueue.Size() < minimumNrMatchers)
			{
				return currentDoc = NO_MORE_DOCS;
			}
			if (target <= currentDoc)
			{
				return currentDoc;
			}
			do 
			{
				if (scorerDocQueue.TopDoc() >= target)
				{
					return AdvanceAfterCurrent()?currentDoc:(currentDoc = NO_MORE_DOCS);
				}
				else if (!scorerDocQueue.TopSkipToAndAdjustElsePop(target))
				{
					if (scorerDocQueue.Size() < minimumNrMatchers)
					{
						return currentDoc = NO_MORE_DOCS;
					}
				}
			}
			while (true);
		}
	}