Ejemplo n.º 1
0
 private int AdvanceToCommon(int scorerDoc, int disiDoc)
 {
     while (scorerDoc != disiDoc)
     {
         if (scorerDoc < disiDoc)
         {
             scorerDoc = scorer.Advance(disiDoc);
         }
         else
         {
             disiDoc = docIdSetIterator.Advance(scorerDoc);
         }
     }
     return(scorerDoc);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Perform an inplace AND with the doc ids from a given DocIdSetIterator,
 /// leaving only the bits set for which the doc ids are in common.
 /// These doc ids should be smaller than the maximum size passed to the
 /// constructor.
 /// </summary>
 public virtual void InPlaceAnd(DocIdSetIterator disi)
 {
     int bitSetDoc = NextSetBit(0);
     int disiDoc;
     while (bitSetDoc != -1 && (disiDoc = disi.Advance(bitSetDoc)) != DocIdSetIterator.NO_MORE_DOCS)
     {
         Clear(bitSetDoc, disiDoc);
         bitSetDoc = NextSetBit(disiDoc + 1);
     }
     if (bitSetDoc != -1)
     {
         Clear(bitSetDoc, Size());
     }
 }
Ejemplo n.º 3
0
        /// <summary> Perform an inplace AND with the doc ids from a given DocIdSetIterator,
        /// leaving only the bits set for which the doc ids are in common.
        /// These doc ids should be smaller than the maximum size passed to the
        /// constructor.
        /// </summary>
        public virtual void  InPlaceAnd(DocIdSetIterator disi, IState state)
        {
            int bitSetDoc = NextSetBit(0);
            int disiDoc;

            while (bitSetDoc != -1 && (disiDoc = disi.Advance(bitSetDoc, state)) != DocIdSetIterator.NO_MORE_DOCS)
            {
                Clear(bitSetDoc, disiDoc);
                bitSetDoc = NextSetBit(disiDoc + 1);
            }
            if (bitSetDoc != -1)
            {
                Clear(bitSetDoc, Size());
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Perform an inplace AND with the doc ids from a given <see cref="DocIdSetIterator"/>,
        /// leaving only the bits set for which the doc ids are in common.
        /// These doc ids should be smaller than the maximum size passed to the
        /// constructor.
        /// </summary>
        public virtual void InPlaceAnd(DocIdSetIterator disi)
        {
            int bitSetDoc = NextSetBit(0);
            int disiDoc;

            while (bitSetDoc != -1 && (disiDoc = disi.Advance(bitSetDoc)) != DocIdSetIterator.NO_MORE_DOCS)
            {
                Clear(bitSetDoc, disiDoc);
                bitSetDoc = NextSetBit(disiDoc + 1);
            }
            if (bitSetDoc != -1)
            {
                Clear(bitSetDoc, Length); // LUCENENET specific - using Length in place of Size (since they are the same)
            }
        }