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

AdvanceAfterCurrent() protected method

Advance all subscorers after the current document determined by the top of the scorerDocQueue. Repeat until at least the minimum number of subscorers match on the same document and all subscorers are after that document or are exhausted.
On entry the scorerDocQueue has at least minimumNrMatchers available. At least the scorer with the minimum document number will be advanced.
protected AdvanceAfterCurrent ( ) : bool
return bool
		protected internal virtual bool AdvanceAfterCurrent()
		{
			do 
			{
				// repeat until minimum nr of matchers
				currentDoc = scorerDocQueue.TopDoc();
				currentScore = scorerDocQueue.TopScore();
				nrMatchers = 1;
				do 
				{
					// Until all subscorers are after currentDoc
					if (!scorerDocQueue.TopNextAndAdjustElsePop())
					{
						if (scorerDocQueue.Size() == 0)
						{
							break; // nothing more to advance, check for last match.
						}
					}
					if (scorerDocQueue.TopDoc() != currentDoc)
					{
						break; // All remaining subscorers are after currentDoc.
					}
					currentScore += scorerDocQueue.TopScore();
					nrMatchers++;
				}
				while (true);
				
				if (nrMatchers >= minimumNrMatchers)
				{
					return true;
				}
				else if (scorerDocQueue.Size() < minimumNrMatchers)
				{
					return false;
				}
			}
			while (true);
		}