Abstract decorator class for a DocIdSet implementation that provides on-demand filtering/validation mechanism on a given DocIdSet.

Technically, this same functionality could be achieved with ChainedFilter (under queries/), however the benefit of this class is it never materializes the full bitset for the filter. Instead, the #match method is invoked on-demand, per docID visited during searching. If you know few docIDs will be visited, and the logic behind #match is relatively costly, this may be a better way to filter than ChainedFilter.

Inheritance: Lucene.Net.Search.DocIdSet
 private void InitBlock(FilteredDocIdSet enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
 public AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance)
     : base(null)
 {
     System.Diagnostics.Debug.Fail("Port issue:", "Lets see if we need this"); // {{Aroush-2.9}}
     InitBlock(enclosingInstance);
 }
 internal AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance, Lucene.Net.Search.DocIdSetIterator Param1)
     : base(Param1)
 {
     InitBlock(enclosingInstance);
 }
Exemple #4
0
 public FilteredDocIdSetIteratorAnonymousClass(FilteredDocIdSet outerInstance, Lucene.Net.Search.DocIdSetIterator iterator)
     : base(iterator)
 {
     this.outerInstance = outerInstance;
 }
Exemple #5
0
 public BitsAnonymousClass(FilteredDocIdSet outerInstance, IBits bits)
 {
     this.outerInstance = outerInstance;
     this.bits          = bits;
 }
Exemple #6
0
 public FilteredDocIdSetIteratorAnonymousInnerClassHelper(FilteredDocIdSet outerInstance, Lucene.Net.Search.DocIdSetIterator iterator)
     : base(iterator)
 {
     this.OuterInstance = outerInstance;
 }
Exemple #7
0
 public BitsAnonymousInnerClassHelper(FilteredDocIdSet outerInstance, Bits bits)
 {
     this.OuterInstance = outerInstance;
     this.Bits = bits;
 }
		public virtual void  TestFilteredDocIdSet()
		{
			int maxdoc = 10;
			DocIdSet innerSet = new AnonymousClassDocIdSet_Renamed_Class(maxdoc, this);


            DocIdSet filteredSet = new FilteredDocIdSet(innerSet, (docid) =>
            {
                return docid % 2 == 0; //validate only even docids
            });
			
			DocIdSetIterator iter = filteredSet.Iterator();
			System.Collections.ArrayList list = new System.Collections.ArrayList();
			int doc = iter.Advance(3);
			if (doc != DocIdSetIterator.NO_MORE_DOCS)
			{
				list.Add((System.Int32) doc);
				while ((doc = iter.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
				{
					list.Add((System.Int32) doc);
				}
			}
			
			int[] docs = new int[list.Count];
			int c = 0;
			System.Collections.IEnumerator intIter = list.GetEnumerator();
			while (intIter.MoveNext())
			{
				docs[c++] = ((System.Int32) intIter.Current);
			}
			int[] answer = new int[]{4, 6, 8};
			bool same = Support.CollectionsHelper.Equals(answer, docs);
			if (!same)
			{
				System.Console.Out.WriteLine("answer: " + _TestUtil.ArrayToString(answer));
				System.Console.Out.WriteLine("gotten: " + _TestUtil.ArrayToString(docs));
				Assert.Fail();
			}
		}
Exemple #9
0
 internal AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance, Lucene.Net.Search.DocIdSetIterator Param1) : base(Param1)
 {
     InitBlock(enclosingInstance);
 }
Exemple #10
0
 private void InitBlock(FilteredDocIdSet enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
Exemple #11
0
 public AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance) : base(null)
 {
     System.Diagnostics.Debug.Fail("Port issue:", "Lets see if we need this"); // {{Aroush-2.9}}
     InitBlock(enclosingInstance);
 }
Exemple #12
0
 public BitsAnonymousInnerClassHelper(FilteredDocIdSet outerInstance, Bits bits)
 {
     this.OuterInstance = outerInstance;
     this.Bits          = bits;
 }