예제 #1
0
 public override PostingsConsumer StartTerm(BytesRef text)
 {
     Debug.Assert(state == TermsConsumerState.INITIAL || state == TermsConsumerState.START && lastPostingsConsumer.docFreq == 0);
     state = TermsConsumerState.START;
     Debug.Assert(lastTerm == null || @in.Comparer.Compare(text, lastTerm) > 0);
     lastTerm = BytesRef.DeepCopyOf(text);
     return(lastPostingsConsumer = new AssertingPostingsConsumer(@in.StartTerm(text), fieldInfo, visitedDocs));
 }
예제 #2
0
 public override PostingsConsumer StartTerm(BytesRef text)
 {
     Debug.Assert(State == TermsConsumerState.INITIAL || State == TermsConsumerState.START && LastPostingsConsumer.DocFreq == 0);
     State = TermsConsumerState.START;
     Debug.Assert(LastTerm == null || @in.Comparator.Compare(text, LastTerm) > 0);
     LastTerm = BytesRef.DeepCopyOf(text);
     return(LastPostingsConsumer = new AssertingPostingsConsumer(@in.StartTerm(text), fieldInfo, VisitedDocs));
 }
예제 #3
0
 public override void Finish(long sumTotalTermFreq, long sumDocFreq, int docCount)
 {
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(state == TermsConsumerState.INITIAL || state == TermsConsumerState.START && lastPostingsConsumer.docFreq == 0);
     }
     state = TermsConsumerState.FINISHED;
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(docCount >= 0);
     }
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(docCount == visitedDocs.Cardinality);
     }
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(sumDocFreq >= docCount);
     }
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(sumDocFreq == this.sumDocFreq);
     }
     if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
     {
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(sumTotalTermFreq == -1);
         }
     }
     else
     {
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(sumTotalTermFreq >= sumDocFreq);
         }
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(sumTotalTermFreq == this.sumTotalTermFreq);
         }
     }
     @in.Finish(sumTotalTermFreq, sumDocFreq, docCount);
 }
예제 #4
0
 public override void FinishTerm(BytesRef text, TermStats stats)
 {
     Debug.Assert(state == TermsConsumerState.START);
     state = TermsConsumerState.INITIAL;
     Debug.Assert(text.Equals(lastTerm));
     Debug.Assert(stats.DocFreq > 0); // otherwise, this method should not be called.
     Debug.Assert(stats.DocFreq == lastPostingsConsumer.docFreq);
     sumDocFreq += stats.DocFreq;
     if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
     {
         Debug.Assert(stats.TotalTermFreq == -1);
     }
     else
     {
         Debug.Assert(stats.TotalTermFreq == lastPostingsConsumer.totalTermFreq);
         sumTotalTermFreq += stats.TotalTermFreq;
     }
     @in.FinishTerm(text, stats);
 }
예제 #5
0
 public override void Finish(long sumTotalTermFreq, long sumDocFreq, int docCount)
 {
     Debug.Assert(State == TermsConsumerState.INITIAL || State == TermsConsumerState.START && LastPostingsConsumer.DocFreq == 0);
     State = TermsConsumerState.FINISHED;
     Debug.Assert(docCount >= 0);
     Debug.Assert(docCount == VisitedDocs.Cardinality());
     Debug.Assert(sumDocFreq >= docCount);
     Debug.Assert(sumDocFreq == this.SumDocFreq);
     if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
     {
         Debug.Assert(sumTotalTermFreq == -1);
     }
     else
     {
         Debug.Assert(sumTotalTermFreq >= sumDocFreq);
         Debug.Assert(sumTotalTermFreq == this.SumTotalTermFreq);
     }
     @in.Finish(sumTotalTermFreq, sumDocFreq, docCount);
 }
 public override PostingsConsumer StartTerm(BytesRef text)
 {
     Debug.Assert(State == TermsConsumerState.INITIAL || State == TermsConsumerState.START && LastPostingsConsumer.DocFreq == 0);
     State = TermsConsumerState.START;
     Debug.Assert(LastTerm == null || @in.Comparator.Compare(text, LastTerm) > 0);
     LastTerm = BytesRef.DeepCopyOf(text);
     return LastPostingsConsumer = new AssertingPostingsConsumer(@in.StartTerm(text), fieldInfo, VisitedDocs);
 }
 public override void FinishTerm(BytesRef text, TermStats stats)
 {
     Debug.Assert(State == TermsConsumerState.START);
     State = TermsConsumerState.INITIAL;
     Debug.Assert(text.Equals(LastTerm));
     Debug.Assert(stats.DocFreq > 0); // otherwise, this method should not be called.
     Debug.Assert(stats.DocFreq == LastPostingsConsumer.DocFreq);
     SumDocFreq += stats.DocFreq;
     if (fieldInfo.FieldIndexOptions == FieldInfo.IndexOptions.DOCS_ONLY)
     {
         Debug.Assert(stats.TotalTermFreq == -1);
     }
     else
     {
         Debug.Assert(stats.TotalTermFreq == LastPostingsConsumer.TotalTermFreq);
         SumTotalTermFreq += stats.TotalTermFreq;
     }
     @in.FinishTerm(text, stats);
 }
 public override void Finish(long sumTotalTermFreq, long sumDocFreq, int docCount)
 {
     Debug.Assert(State == TermsConsumerState.INITIAL || State == TermsConsumerState.START && LastPostingsConsumer.DocFreq == 0);
     State = TermsConsumerState.FINISHED;
     Debug.Assert(docCount >= 0);
     Debug.Assert(docCount == VisitedDocs.Cardinality());
     Debug.Assert(sumDocFreq >= docCount);
     Debug.Assert(sumDocFreq == this.SumDocFreq);
     if (fieldInfo.FieldIndexOptions == FieldInfo.IndexOptions.DOCS_ONLY)
     {
         Debug.Assert(sumTotalTermFreq == -1);
     }
     else
     {
         Debug.Assert(sumTotalTermFreq >= sumDocFreq);
         Debug.Assert(sumTotalTermFreq == this.SumTotalTermFreq);
     }
     @in.Finish(sumTotalTermFreq, sumDocFreq, docCount);
 }