Ejemplo n.º 1
0
 /**
  * Perform an inplace NOT with the doc ids from a given DocIdSetIterator,
  * clearing all the bits for each such doc id.
  * These doc ids should be smaller than the maximum size passed to the
  * constructor.
  */
 public void InPlaceNot(DocIdSetIterator disi)
 {
     while (disi.Next() && (disi.Doc() < Size()))
     {
         FastClear(disi.Doc());
     }
 }
Ejemplo n.º 2
0
 /**
  * Perform an inplace OR with the doc ids from a given DocIdSetIterator,
  * setting the bit for each such doc id.
  * These doc ids should be smaller than the maximum size passed to the
  * constructor.
  */
 public void InPlaceOr(DocIdSetIterator disi)
 {
     while (disi.Next() && (disi.Doc() < Size()))
     {
         FastSet(disi.Doc());
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Perform an inplace NOT with the doc ids from a given DocIdSetIterator,
 /// clearing all the bits for each such doc id.
 /// These doc ids should be smaller than the maximum size passed to the
 /// constructor.
 /// </summary>
 public virtual void InPlaceNot(DocIdSetIterator disi)
 {
     int doc;
     long size = Size();
     while ((doc = disi.NextDoc()) < size)
     {
         FastClear(doc);
     }
 }
Ejemplo n.º 4
0
        /**
         * Create a SortedVIntList.
         * @param  docIdSetIterator  An iterator providing document numbers as a set of integers.
         *                  This DocIdSetIterator is iterated completely when this constructor
         *                  is called and it must provide the integers in non
         *                  decreasing order.
         */
        public SortedVIntList(DocIdSetIterator docIdSetIterator)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);

            while (docIdSetIterator.Next())
            {
                builder.AddInt(docIdSetIterator.Doc());
            }
            builder.Done();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Perform an inplace NOT with the doc ids from a given <see cref="DocIdSetIterator"/>,
        /// clearing all the bits for each such doc id.
        /// These doc ids should be smaller than the maximum size passed to the
        /// constructor.
        /// </summary>
        public virtual void InPlaceNot(DocIdSetIterator disi)
        {
            int  doc;
            long size = Length; // LUCENENET specific - using Length in place of Size (since they are the same)

            while ((doc = disi.NextDoc()) < size)
            {
                FastClear(doc);
            }
        }
Ejemplo n.º 6
0
        /// <summary> Perform an inplace OR with the doc ids from a given DocIdSetIterator,
        /// setting the bit for each such doc id.
        /// These doc ids should be smaller than the maximum size passed to the
        /// constructor.
        /// </summary>
        public virtual void  InPlaceOr(DocIdSetIterator disi)
        {
            int  doc;
            long size = Size();

            while ((doc = disi.NextDoc()) < size)
            {
                FastSet(doc);
            }
        }
Ejemplo n.º 7
0
        /// <summary> Perform an inplace NOT with the doc ids from a given DocIdSetIterator,
        /// clearing all the bits for each such doc id.
        /// These doc ids should be smaller than the maximum size passed to the
        /// constructor.
        /// </summary>
        public virtual void  InPlaceNot(DocIdSetIterator disi, IState state)
        {
            int  doc;
            long size = Size();

            while ((doc = disi.NextDoc(state)) < size)
            {
                FastClear(doc);
            }
        }
Ejemplo n.º 8
0
        /// <summary> Create a SortedVIntList.</summary>
        /// <param name="docIdSetIterator"> An iterator providing document numbers as a set of integers.
        /// This DocIdSetIterator is iterated completely when this constructor
        /// is called and it must provide the integers in non
        /// decreasing order.
        /// </param>
        public SortedVIntList(DocIdSetIterator docIdSetIterator)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
            int doc;

            while ((doc = docIdSetIterator.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
            {
                builder.AddInt(doc);
            }
            builder.Done();
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Encode the document ids from a DocIdSetIterator. </summary>
 ///  <param name="disi"> this DocIdSetIterator should provide document ids that are consistent
 ///              with <code>numValues</code> and <code>upperBound</code> as provided to the constructor.   </param>
 public virtual void EncodeFromDisi(DocIdSetIterator disi)
 {
     while (EfEncoder.NumEncoded < EfEncoder.NumValues)
     {
         int x = disi.NextDoc();
         if (x == DocIdSetIterator.NO_MORE_DOCS)
         {
             throw new System.ArgumentException("disi: " + disi.ToString() + "\nhas " + EfEncoder.NumEncoded + " docs, but at least " + EfEncoder.NumValues + " are required.");
         }
         EfEncoder.EncodeNext(x);
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Encode the document ids from a DocIdSetIterator. </summary>
 ///  <param name="disi"> this DocIdSetIterator should provide document ids that are consistent
 ///              with <code>numValues</code> and <code>upperBound</code> as provided to the constructor.   </param>
 public virtual void EncodeFromDisi(DocIdSetIterator disi)
 {
     while (EfEncoder.NumEncoded < EfEncoder.NumValues)
     {
         int x = disi.NextDoc();
         if (x == DocIdSetIterator.NO_MORE_DOCS)
         {
             throw new System.ArgumentException("disi: " + disi.ToString() + "\nhas " + EfEncoder.NumEncoded + " docs, but at least " + EfEncoder.NumValues + " are required.");
         }
         EfEncoder.EncodeNext(x);
     }
 }
Ejemplo n.º 11
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.º 12
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)
            }
        }
Ejemplo n.º 13
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.º 14
0
        internal virtual void  TstIterator(SortedVIntList vintList, int[] ints)
        {
            for (int i = 0; i < ints.Length; i++)
            {
                if ((i > 0) && (ints[i - 1] == ints[i]))
                {
                    return;                      // DocNrSkipper should not skip to same document.
                }
            }
            DocIdSetIterator m = vintList.Iterator();

            for (int i = 0; i < ints.Length; i++)
            {
                Assert.IsTrue(m.NextDoc() != DocIdSetIterator.NO_MORE_DOCS, "No end of Matcher at: " + i);
                Assert.AreEqual(ints[i], m.DocID());
            }
            Assert.IsTrue(m.NextDoc() == DocIdSetIterator.NO_MORE_DOCS, "End of Matcher");
        }
Ejemplo n.º 15
0
 /**
  * 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.
  */
 public void InPlaceAnd(DocIdSetIterator disi)
 {
     int index = NextSetBit(0);
     int lastNotCleared = -1;
     while ((index != -1) && disi.SkipTo(index))
     {
         while ((index != -1) && (index < disi.Doc()))
         {
             FastClear(index);
             index = NextSetBit(index + 1);
         }
         if (index == disi.Doc())
         {
             lastNotCleared = index;
             index++;
         }
         System.Diagnostics.Debug.Assert((index == -1) || (index > disi.Doc()));
     }
     Clear(lastNotCleared + 1, Size());
 }
Ejemplo n.º 16
0
        /**
         * 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.
         */
        public void InPlaceAnd(DocIdSetIterator disi)
        {
            int index          = NextSetBit(0);
            int lastNotCleared = -1;

            while ((index != -1) && disi.SkipTo(index))
            {
                while ((index != -1) && (index < disi.Doc()))
                {
                    FastClear(index);
                    index = NextSetBit(index + 1);
                }
                if (index == disi.Doc())
                {
                    lastNotCleared = index;
                    index++;
                }
                System.Diagnostics.Debug.Assert((index == -1) || (index > disi.Doc()));
            }
            Clear(lastNotCleared + 1, Size());
        }
Ejemplo n.º 17
0
 /// <summary>Construct an OpenBitSetDISI with its bits set
 /// from the doc ids of the given DocIdSetIterator.
 /// Also give a maximum size one larger than the largest doc id for which a
 /// bit may ever be set on this OpenBitSetDISI.
 /// </summary>
 public OpenBitSetDISI(DocIdSetIterator disi, int maxSize, IState state) : base(maxSize)
 {
     InPlaceOr(disi, state);
 }
Ejemplo n.º 18
0
 public FilteredDocIdSetIteratorAnonymousInnerClassHelper(FieldCacheDocIdSet outerInstance, Lucene.Net.Search.DocIdSetIterator iterator)
     : base(iterator)
 {
     this.outerInstance = outerInstance;
 }
Ejemplo n.º 19
0
 /**
  * Create a SortedVIntList.
  * @param  docIdSetIterator  An iterator providing document numbers as a set of integers.
  *                  This DocIdSetIterator is iterated completely when this constructor
  *                  is called and it must provide the integers in non
  *                  decreasing order.
  */
 public SortedVIntList(DocIdSetIterator docIdSetIterator)
 {
     SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
     while (docIdSetIterator.Next())
     {
         builder.AddInt(docIdSetIterator.Doc());
     }
     builder.Done();
 }
Ejemplo n.º 20
0
 /**
  * Perform an inplace NOT with the doc ids from a given DocIdSetIterator,
  * clearing all the bits for each such doc id.
  * These doc ids should be smaller than the maximum size passed to the
  * constructor.
  */
 public void InPlaceNot(DocIdSetIterator disi)
 {
     while (disi.Next() && (disi.Doc() < Size()))
     {
         FastClear(disi.Doc());
     }
 }
Ejemplo n.º 21
0
 /** Construct an OpenBitSetDISI with its bits set
  * from the doc ids of the given DocIdSetIterator.
  * Also give a maximum size one larger than the largest doc id for which a
  * bit may ever be set on this OpenBitSetDISI.
  */
 public OpenBitSetDISI(DocIdSetIterator disi, int maxSize)
     : base(maxSize)
 {
     InPlaceOr(disi);
 }
Ejemplo n.º 22
0
 /**
  * Perform an inplace XOR with the doc ids from a given DocIdSetIterator,
  * flipping all the bits for each such doc id.
  * These doc ids should be smaller than the maximum size passed to the
  * constructor.
  */
 public void InPlaceXor(DocIdSetIterator disi)
 {
     while (disi.Next() && (disi.Doc() < Size()))
     {
         FastFlip(disi.Doc());
     }
 }
Ejemplo n.º 23
0
 private void InitBlock(Lucene.Net.Search.Scorer scorer, Lucene.Net.Search.DocIdSetIterator docIdSetIterator, AnonymousClassWeight enclosingInstance)
 {
     this.scorer = scorer;
     this.docIdSetIterator = docIdSetIterator;
     this.enclosingInstance = enclosingInstance;
 }
Ejemplo n.º 24
0
 public FilteredDocIdSetIteratorAnonymousClass(FilteredDocIdSet outerInstance, Lucene.Net.Search.DocIdSetIterator iterator)
     : base(iterator)
 {
     this.outerInstance = outerInstance;
 }
Ejemplo n.º 25
0
 internal AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance, Lucene.Net.Search.DocIdSetIterator Param1) : base(Param1)
 {
     InitBlock(enclosingInstance);
 }
Ejemplo n.º 26
0
 private void  InitBlock(Lucene.Net.Search.Scorer scorer, Lucene.Net.Search.DocIdSetIterator docIdSetIterator, AnonymousClassWeight enclosingInstance)
 {
     this.scorer            = scorer;
     this.docIdSetIterator  = docIdSetIterator;
     this.enclosingInstance = enclosingInstance;
 }
Ejemplo n.º 27
0
 internal AnonymousClassScorer(Lucene.Net.Search.Scorer scorer, Lucene.Net.Search.DocIdSetIterator docIdSetIterator, AnonymousClassWeight enclosingInstance, Lucene.Net.Search.Similarity Param1) : base(Param1)
 {
     InitBlock(scorer, docIdSetIterator, enclosingInstance);
 }
Ejemplo n.º 28
0
		/// <summary> Create a SortedVIntList.</summary>
		/// <param name="docIdSetIterator"> An iterator providing document numbers as a set of integers.
		/// This DocIdSetIterator is iterated completely when this constructor
		/// is called and it must provide the integers in non
		/// decreasing order.
		/// </param>
		public SortedVIntList(DocIdSetIterator docIdSetIterator)
		{
			SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
			int doc;
			while ((doc = docIdSetIterator.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
			{
				builder.AddInt(doc);
			}
			builder.Done();
		}