示例#1
0
 public SubScorer(Scorer scorer, bool required, bool prohibited, HitCollector collector, SubScorer next)
 {
     this.scorer     = scorer;
     this.done       = !scorer.Next();
     this.required   = required;
     this.prohibited = prohibited;
     this.collector  = collector;
     this.next       = next;
 }
示例#2
0
			public SubScorer(Scorer scorer, bool required, bool prohibited, HitCollector collector, SubScorer next)
			{
				this.scorer = scorer;
				this.done = !scorer.Next();
				this.required = required;
				this.prohibited = prohibited;
				this.collector = collector;
				this.next = next;
			}
示例#3
0
        public override bool Next()
        {
            bool more;

            do
            {
                while (bucketTable.first != null)
                {
                    // more queued
                    current           = bucketTable.first;
                    bucketTable.first = current.next;                     // pop the queue

                    // check prohibited & required
                    if ((current.bits & prohibitedMask) == 0 && (current.bits & requiredMask) == requiredMask)
                    {
                        return(true);
                    }
                }

                // refill the queue
                more = false;
                end += BucketTable.SIZE;
                for (SubScorer sub = scorers; sub != null; sub = sub.next)
                {
                    Scorer scorer = sub.scorer;
                    while (!sub.done && scorer.Doc() < end)
                    {
                        sub.collector.Collect(scorer.Doc(), scorer.Score());
                        sub.done = !scorer.Next();
                    }
                    if (!sub.done)
                    {
                        more = true;
                    }
                }
            }while (bucketTable.first != null | more);

            return(false);
        }