/** * 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()); } }
/** * 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()); } }
/// <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); } }
/** * 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(); }
/// <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); } }
/// <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); } }
/// <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); } }
/// <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(); }
/// <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); } }
/// <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); } }
/// <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()); } }
/// <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) } }
/// <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()); } }
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"); }
/** * 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()); }
/** * 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()); }
/// <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); }
public FilteredDocIdSetIteratorAnonymousInnerClassHelper(FieldCacheDocIdSet outerInstance, Lucene.Net.Search.DocIdSetIterator iterator) : base(iterator) { this.outerInstance = outerInstance; }
/** * 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(); }
/** * 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()); } }
/** 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); }
/** * 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()); } }
private void InitBlock(Lucene.Net.Search.Scorer scorer, Lucene.Net.Search.DocIdSetIterator docIdSetIterator, AnonymousClassWeight enclosingInstance) { this.scorer = scorer; this.docIdSetIterator = docIdSetIterator; this.enclosingInstance = enclosingInstance; }
public FilteredDocIdSetIteratorAnonymousClass(FilteredDocIdSet outerInstance, Lucene.Net.Search.DocIdSetIterator iterator) : base(iterator) { this.outerInstance = outerInstance; }
internal AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance, Lucene.Net.Search.DocIdSetIterator Param1) : base(Param1) { InitBlock(enclosingInstance); }
private void InitBlock(Lucene.Net.Search.Scorer scorer, Lucene.Net.Search.DocIdSetIterator docIdSetIterator, AnonymousClassWeight enclosingInstance) { this.scorer = scorer; this.docIdSetIterator = docIdSetIterator; this.enclosingInstance = enclosingInstance; }
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); }
/// <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(); }