Beispiel #1
0
 public override void StartDoc(int docID, int freq)
 {
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(state == PostingsConsumerState.INITIAL);
     }
     state = PostingsConsumerState.START;
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(docID >= 0);
     }
     if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
     {
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(freq == -1);
         }
         this.freq = 0; // we don't expect any positions here
     }
     else
     {
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(freq > 0);
         }
         this.freq      = freq;
         totalTermFreq += freq;
     }
     this.positionCount   = 0;
     this.lastPosition    = 0;
     this.lastStartOffset = 0;
     docFreq++;
     visitedDocs.Set(docID);
     @in.StartDoc(docID, freq);
 }
Beispiel #2
0
 public override void FinishDoc()
 {
     Debug.Assert(state == PostingsConsumerState.START);
     state = PostingsConsumerState.INITIAL;
     if (fieldInfo.IndexOptions.CompareTo(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0)
     {
         Debug.Assert(positionCount == 0); // we should not have fed any positions!
     }
     else
     {
         Debug.Assert(positionCount == freq);
     }
     @in.FinishDoc();
 }
Beispiel #3
0
 public override void StartDoc(int docID, int freq)
 {
     Debug.Assert(State == PostingsConsumerState.INITIAL);
     State = PostingsConsumerState.START;
     Debug.Assert(docID >= 0);
     if (fieldInfo.IndexOptions == IndexOptions.DOCS_ONLY)
     {
         Debug.Assert(freq == -1);
         this.Freq = 0; // we don't expect any positions here
     }
     else
     {
         Debug.Assert(freq > 0);
         this.Freq      = freq;
         TotalTermFreq += freq;
     }
     this.PositionCount   = 0;
     this.LastPosition    = 0;
     this.LastStartOffset = 0;
     DocFreq++;
     VisitedDocs.Set(docID);
     @in.StartDoc(docID, freq);
 }
Beispiel #4
0
 public override void FinishDoc()
 {
     if (Debugging.AssertsEnabled)
     {
         Debugging.Assert(state == PostingsConsumerState.START);
     }
     state = PostingsConsumerState.INITIAL;
     // LUCENENET specific - to avoid boxing, changed from CompareTo() to IndexOptionsComparer.Compare()
     if (IndexOptionsComparer.Default.Compare(fieldInfo.IndexOptions, IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) < 0)
     {
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(positionCount == 0);                           // we should not have fed any positions!
         }
     }
     else
     {
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(positionCount == freq);
         }
     }
     @in.FinishDoc();
 }
 public override void StartDoc(int docID, int freq)
 {
     Debug.Assert(State == PostingsConsumerState.INITIAL);
     State = PostingsConsumerState.START;
     Debug.Assert(docID >= 0);
     if (fieldInfo.FieldIndexOptions == FieldInfo.IndexOptions.DOCS_ONLY)
     {
         Debug.Assert(freq == -1);
         this.Freq = 0; // we don't expect any positions here
     }
     else
     {
         Debug.Assert(freq > 0);
         this.Freq = freq;
         TotalTermFreq += freq;
     }
     this.PositionCount = 0;
     this.LastPosition = 0;
     this.LastStartOffset = 0;
     DocFreq++;
     VisitedDocs.Set(docID);
     @in.StartDoc(docID, freq);
 }
 public override void FinishDoc()
 {
     Debug.Assert(State == PostingsConsumerState.START);
     State = PostingsConsumerState.INITIAL;
     if (fieldInfo.FieldIndexOptions < FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS)
     {
         Debug.Assert(PositionCount == 0); // we should not have fed any positions!
     }
     else
     {
         Debug.Assert(PositionCount == Freq);
     }
     @in.FinishDoc();
 }