lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [Lucene.Net] svn commit: r1104510 - in /incubator/lucene.net/branches/Lucene.Net_2_9_4g: src/core/Search/ test/core/Search/
Date Tue, 17 May 2011 20:05:21 GMT
Author: digy
Date: Tue May 17 20:05:20 2011
New Revision: 1104510

URL: http://svn.apache.org/viewvc?rev=1104510&view=rev
Log:
[LUCENENET-412]

Modified:
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingSpanFilter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingWrapperFilter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/DocIdSet.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSet.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSetIterator.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/JustCompileSearch.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestCachingWrapperFilter.cs
    incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestDocIdSet.cs

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingSpanFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingSpanFilter.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingSpanFilter.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingSpanFilter.cs Tue
May 17 20:05:20 2011
@@ -33,7 +33,7 @@ namespace Lucene.Net.Search
 		
 		/// <summary> A transient Filter cache.</summary>
 		[NonSerialized]
-        internal CachingWrapperFilter.FilterCache cache;
+        internal CachingWrapperFilter.FilterCache<SpanFilterResult> cache;
 
         /// <summary>
         /// New deletions always result in a cache miss, by default
@@ -57,19 +57,11 @@ namespace Lucene.Net.Search
             {
                 throw new System.ArgumentException("DeletesMode.DYNAMIC is not supported");
             }
-            this.cache = new AnonymousFilterCache(deletesMode);
-        }
-
-        class AnonymousFilterCache : CachingWrapperFilter.FilterCache
-        {
-            public AnonymousFilterCache(CachingWrapperFilter.DeletesMode deletesMode) : base(deletesMode)
-            {
-            }
-
-            protected override object MergeDeletes(IndexReader reader, object docIdSet)
-            {
-                throw new System.ArgumentException("DeletesMode.DYNAMIC is not supported");
-            }
+            this.cache = new CachingWrapperFilter.FilterCache<SpanFilterResult>(deletesMode,

+                (r, value) =>
+                {
+                    throw new System.ArgumentException("DeletesMode.DYNAMIC is not supported");
+                });
         }
 
 		/// <deprecated> Use {@link #GetDocIdSet(IndexReader)} instead.

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingWrapperFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingWrapperFilter.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingWrapperFilter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/CachingWrapperFilter.cs
Tue May 17 20:05:20 2011
@@ -67,34 +67,35 @@ namespace Lucene.Net.Search
             public static DeletesMode DYNAMIC = new DeletesMode("DYNAMIC");
         }
 
-		internal FilterCache cache;
+		internal FilterCache<DocIdSet> cache;
 
         [Serializable]
-        abstract internal class FilterCache 
+        internal class FilterCache<T>
         {
             /**
              * A transient Filter cache (package private because of test)
              */
             // NOTE: not final so that we can dynamically re-init
             // after de-serialize
-            volatile IDictionary cache;
+            volatile IDictionary<object,T> cache;
 
             private DeletesMode deletesMode;
 
-            public FilterCache(DeletesMode deletesMode)
+            public FilterCache(DeletesMode deletesMode, Func<IndexReader, object, object>
mergeDeletes)
             {
                 this.deletesMode = deletesMode;
+                this.MergeDeletes = mergeDeletes;
             }
 
-            public Object Get(IndexReader reader, object coreKey, object delCoreKey)
+            public T Get(IndexReader reader, object coreKey, object delCoreKey)
             {
                 lock (this)
                 {
-                    object value;
+                    T value;
 
                     if (cache == null)
                     {
-                        cache = new Support.WeakHashTable();
+                        cache = new Support.WeakDictionary<object,T>();
                     }
 
                     if (deletesMode == DeletesMode.IGNORE)
@@ -122,7 +123,7 @@ namespace Lucene.Net.Search
                             value = cache[coreKey];
                             if (value != null && reader.HasDeletions())
                             {
-                                value = MergeDeletes(reader, value);
+                                value = (T)MergeDeletes(reader, value);
                             }
                         }
                     }
@@ -131,9 +132,10 @@ namespace Lucene.Net.Search
 
             }
        
-            protected abstract object MergeDeletes(IndexReader reader, object value);
+            //protected abstract object MergeDeletes(IndexReader reader, object value);
+            Func<IndexReader, object, object> MergeDeletes;
 
-            public void Put(object coreKey, object delCoreKey, object value)
+            public void Put(object coreKey, object delCoreKey, T value)
             {
                 if (deletesMode == DeletesMode.IGNORE)
                 {
@@ -176,7 +178,14 @@ namespace Lucene.Net.Search
         public CachingWrapperFilter(Filter filter, DeletesMode deletesMode)
         {
             this.filter = filter;
-            cache = new AnonymousFilterCache(deletesMode);
+            cache = new FilterCache<DocIdSet>(deletesMode,
+                (reader,docIdSet)=>{
+                return new FilteredDocIdSet((DocIdSet)docIdSet, 
+                    (docid) =>
+                    {
+                        return !reader.IsDeleted(docid);
+                    });
+            });
             
             //cache = new FilterCache(deletesMode) 
             // {
@@ -189,62 +198,6 @@ namespace Lucene.Net.Search
             //  }
             //};
         }
-
-        class AnonymousFilterCache : FilterCache
-        {
-            class AnonymousFilteredDocIdSet : FilteredDocIdSet
-            {
-                IndexReader r;
-                public AnonymousFilteredDocIdSet(DocIdSet innerSet, IndexReader r) : base(innerSet)
-                {
-                    this.r = r;
-                }
-                public override bool Match(int docid)
-                {
-                    return !r.IsDeleted(docid);
-                }
-            }
-
-            public AnonymousFilterCache(DeletesMode deletesMode) : base(deletesMode)
-            {
-            }
-
-            protected  override object MergeDeletes(IndexReader reader, object docIdSet)
-            {
-                return new AnonymousFilteredDocIdSet((DocIdSet)docIdSet, reader);
-            }
-        }
-
-		/// <deprecated> Use {@link #GetDocIdSet(IndexReader)} instead.
-		/// </deprecated>
-        [Obsolete("Use GetDocIdSet(IndexReader) instead.")]
-		public override System.Collections.BitArray Bits(IndexReader reader)
-		{
-			object coreKey = reader.GetFieldCacheKey();
-            object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
-
-            object cached = cache.Get(reader, coreKey, delCoreKey);
-			
-			if (cached != null)
-			{
-				if (cached is System.Collections.BitArray)
-				{
-					return (System.Collections.BitArray) cached;
-				}
-				else if (cached is DocIdBitSet)
-					return ((DocIdBitSet) cached).GetBitSet();
-				// It would be nice to handle the DocIdSet case, but that's not really possible
-			}
-			
-			System.Collections.BitArray bits = filter.Bits(reader);
-
-            if (bits != null)
-            {
-                cache.Put(coreKey, delCoreKey, bits);
-            }
-			
-			return bits;
-		}
 		
 		/// <summary>Provide the DocIdSet to be cached, using the DocIdSet provided
 		/// by the wrapped Filter.
@@ -278,26 +231,24 @@ namespace Lucene.Net.Search
 			object coreKey = reader.GetFieldCacheKey();
             object delCoreKey = reader.HasDeletions() ? reader.GetDeletesCacheKey() : coreKey;
 
-            object cached = cache.Get(reader, coreKey, delCoreKey);
-			
-			if (cached != null)
-			{
+            DocIdSet docIdSet = cache.Get(reader, coreKey, delCoreKey);
+            if (docIdSet != null)
+            {
                 hitCount++;
-				if (cached is DocIdSet)
-					return (DocIdSet) cached;
-				else
-					return new DocIdBitSet((System.Collections.BitArray) cached);
-			}
+                return docIdSet;
+            }
+
             missCount++;
+
             // cache miss
-			DocIdSet docIdSet = DocIdSetToCache(filter.GetDocIdSet(reader), reader);
-			
-			if (docIdSet != null)
-			{
+            docIdSet = DocIdSetToCache(filter.GetDocIdSet(reader), reader);
+
+            if (docIdSet != null)
+            {
                 cache.Put(coreKey, delCoreKey, docIdSet);
-			}
-			
-			return docIdSet;
+            }
+
+            return docIdSet;
 		}
 		
 		public override System.String ToString()

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/DocIdSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/DocIdSet.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/DocIdSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/DocIdSet.cs Tue May 17
20:05:20 2011
@@ -26,31 +26,17 @@ namespace Lucene.Net.Search
 	[Serializable]
 	public abstract class DocIdSet
 	{
-		public class AnonymousClassDocIdSet:DocIdSet
+		internal class AnonymousDocIdSet:DocIdSet
 		{
-			public AnonymousClassDocIdSet()
+            private DocIdSetIterator iterator;
+
+			public AnonymousDocIdSet()
 			{
-				InitBlock();
+                iterator = new AnonymousDocIdSetIterator();
 			}
-			public class AnonymousClassDocIdSetIterator:DocIdSetIterator
+
+			class AnonymousDocIdSetIterator:DocIdSetIterator
 			{
-				public AnonymousClassDocIdSetIterator(AnonymousClassDocIdSet enclosingInstance)
-				{
-					InitBlock(enclosingInstance);
-				}
-				private void  InitBlock(AnonymousClassDocIdSet enclosingInstance)
-				{
-					this.enclosingInstance = enclosingInstance;
-				}
-				private AnonymousClassDocIdSet enclosingInstance;
-				public AnonymousClassDocIdSet Enclosing_Instance
-				{
-					get
-					{
-						return enclosingInstance;
-					}
-					
-				}
 				public override int Advance(int target)
 				{
 					return NO_MORE_DOCS;
@@ -64,13 +50,7 @@ namespace Lucene.Net.Search
 					return NO_MORE_DOCS;
 				}
 			}
-			private void  InitBlock()
-			{
-				iterator = new AnonymousClassDocIdSetIterator(this);
-			}
-			
-			private DocIdSetIterator iterator;
-			
+            
 			public override DocIdSetIterator Iterator()
 			{
 				return iterator;
@@ -105,7 +85,7 @@ namespace Lucene.Net.Search
 		}
 		static DocIdSet()
 		{
-			EMPTY_DOCIDSET = new AnonymousClassDocIdSet();
+			EMPTY_DOCIDSET = new AnonymousDocIdSet();
 		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSet.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSet.cs Tue
May 17 20:05:20 2011
@@ -39,45 +39,17 @@ namespace Lucene.Net.Search
 	/// <seealso cref="DocIdSet">
 	/// </seealso>
 	
-	public abstract class FilteredDocIdSet:DocIdSet
+	public class FilteredDocIdSet:DocIdSet
 	{
-		private class AnonymousClassFilteredDocIdSetIterator:FilteredDocIdSetIterator
-		{
-			public AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance) : base(null)
-			{
-                System.Diagnostics.Debug.Fail("Port issue:", "Lets see if we need this");
// {{Aroush-2.9}}
-				InitBlock(enclosingInstance);
-			}
-			private void InitBlock(FilteredDocIdSet enclosingInstance)
-			{
-				this.enclosingInstance = enclosingInstance;
-			}
-			private FilteredDocIdSet enclosingInstance;
-			public FilteredDocIdSet Enclosing_Instance
-			{
-				get
-				{
-					return enclosingInstance;
-				}
-				
-			}
-			internal AnonymousClassFilteredDocIdSetIterator(FilteredDocIdSet enclosingInstance, Lucene.Net.Search.DocIdSetIterator
Param1):base(Param1)
-			{
-				InitBlock(enclosingInstance);
-			}
-			public /*protected internal*/ override bool Match(int docid)
-			{
-				return Enclosing_Instance.Match(docid);
-			}
-		}
 		private DocIdSet _innerSet;
 		
 		/// <summary> Constructor.</summary>
 		/// <param name="innerSet">Underlying DocIdSet
 		/// </param>
-		public FilteredDocIdSet(DocIdSet innerSet)
+		public FilteredDocIdSet(DocIdSet innerSet,Func<int,bool> match)
 		{
 			_innerSet = innerSet;
+            this.Match = match;
 		}
 		
 		/// <summary>This DocIdSet implementation is cacheable if the inner set is cacheable.
</summary>
@@ -91,7 +63,8 @@ namespace Lucene.Net.Search
 		/// </param>
 		/// <returns> true if input docid should be in the result set, false otherwise.
 		/// </returns>
-		public /*protected internal*/ abstract bool Match(int docid);
+		//public /*protected internal*/ abstract bool Match(int docid);
+        Func<int, bool> Match;
 		
 		/// <summary> Implementation of the contract to build a DocIdSetIterator.</summary>
 		/// <seealso cref="DocIdSetIterator">
@@ -101,7 +74,10 @@ namespace Lucene.Net.Search
 		// @Override
 		public override DocIdSetIterator Iterator()
 		{
-			return new AnonymousClassFilteredDocIdSetIterator(this, _innerSet.Iterator());
+            return new FilteredDocIdSetIterator(_innerSet.Iterator(), (docid) =>
+            {
+                return this.Match(docid);
+            });
 		}
 	}
 }
\ No newline at end of file

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSetIterator.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSetIterator.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSetIterator.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/src/core/Search/FilteredDocIdSetIterator.cs
Tue May 17 20:05:20 2011
@@ -25,7 +25,7 @@ namespace Lucene.Net.Search
 	/// mechanism on an underlying DocIdSetIterator.  See {@link
 	/// FilteredDocIdSet}.
 	/// </summary>
-	public abstract class FilteredDocIdSetIterator:DocIdSetIterator
+	public class FilteredDocIdSetIterator:DocIdSetIterator
 	{
 		protected internal DocIdSetIterator _innerIter;
 		private int doc;
@@ -33,7 +33,7 @@ namespace Lucene.Net.Search
 		/// <summary> Constructor.</summary>
 		/// <param name="innerIter">Underlying DocIdSetIterator.
 		/// </param>
-		public FilteredDocIdSetIterator(DocIdSetIterator innerIter)
+        public FilteredDocIdSetIterator(DocIdSetIterator innerIter, Func<int, bool>
match)
 		{
 			if (innerIter == null)
 			{
@@ -41,6 +41,7 @@ namespace Lucene.Net.Search
 			}
 			_innerIter = innerIter;
 			doc = - 1;
+            this.Match = match;
 		}
 		
 		/// <summary> Validation method to determine whether a docid should be in the result
set.</summary>
@@ -50,7 +51,8 @@ namespace Lucene.Net.Search
 		/// </returns>
 		/// <seealso cref="FilteredDocIdSetIterator(DocIdSetIterator)">
 		/// </seealso>
-		public abstract /*protected internal*/ bool Match(int doc);
+		//public abstract /*protected internal*/ bool Match(int doc);
+        Func<int, bool> Match;
 		
 		/// <deprecated> use {@link #DocID()} instead. 
 		/// </deprecated>

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/JustCompileSearch.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/JustCompileSearch.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/JustCompileSearch.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/JustCompileSearch.cs
Tue May 17 20:05:20 2011
@@ -300,32 +300,6 @@ namespace Lucene.Net.Search
 			// still added here in case someone will add abstract methods in the future.
 		}
 		
-		internal sealed class JustCompileFilteredDocIdSet:FilteredDocIdSet
-		{
-			
-			public JustCompileFilteredDocIdSet(DocIdSet innerSet):base(innerSet)
-			{
-			}
-			
-			public /*protected internal*/ override bool Match(int docid)
-			{
-				throw new System.NotSupportedException(Lucene.Net.Search.JustCompileSearch.UNSUPPORTED_MSG);
-			}
-		}
-		
-		internal sealed class JustCompileFilteredDocIdSetIterator:FilteredDocIdSetIterator
-		{
-			
-			public JustCompileFilteredDocIdSetIterator(DocIdSetIterator innerIter):base(innerIter)
-			{
-			}
-			
-			public /*protected internal*/ override bool Match(int doc)
-			{
-				throw new System.NotSupportedException(Lucene.Net.Search.JustCompileSearch.UNSUPPORTED_MSG);
-			}
-		}
-		
 		internal sealed class JustCompileFilteredTermEnum:FilteredTermEnum
 		{
 			
@@ -355,19 +329,6 @@ namespace Lucene.Net.Search
 			}
 		}
 		
-		/*internal sealed class JustCompilePhraseScorer : Lucene.Net.Search.PhraseScorer    //
{{Not needed for Lucene.Net}}
-		{
-			
-			internal JustCompilePhraseScorer(Weight weight, TermPositions[] tps, int[] offsets, Similarity
similarity, sbyte[] norms):base(weight, tps, offsets, similarity, norms)
-			{
-			}
-			
-			protected internal override float PhraseFreq()
-			{
-				throw new System.NotSupportedException(Lucene.Net.Search.JustCompileSearch.UNSUPPORTED_MSG);
-			}
-		}*/
-		
 		[Serializable]
 		internal sealed class JustCompileQuery:Query
 		{

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestCachingWrapperFilter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestCachingWrapperFilter.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestCachingWrapperFilter.cs
(original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestCachingWrapperFilter.cs
Tue May 17 20:05:20 2011
@@ -41,23 +41,22 @@ namespace Lucene.Net.Search
             IndexWriter writer = new IndexWriter(dir, new KeywordAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
             writer.Close();
 
-            IndexReader reader = IndexReader.Open(dir);
+            IndexReader reader = IndexReader.Open(dir, true);
 
             MockFilter filter = new MockFilter();
             CachingWrapperFilter cacher = new CachingWrapperFilter(filter);
 
             // first time, nested filter is called
             cacher.GetDocIdSet(reader);
-            Assert.IsTrue(filter.WasCalled(), "first time");
+            Assert.IsTrue( filter.WasCalled(),"first time");
 
-            // make sure no exception if cache is holding the wrong bitset
-            cacher.Bits(reader);
+            // make sure no exception if cache is holding the wrong docIdSet
             cacher.GetDocIdSet(reader);
 
             // second time, nested filter should not be called
             filter.Clear();
             cacher.GetDocIdSet(reader);
-            Assert.IsFalse(filter.WasCalled(), "second time");
+            Assert.IsFalse(filter.WasCalled(),"second time" );
 
             reader.Close();
         }

Modified: incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestDocIdSet.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestDocIdSet.cs?rev=1104510&r1=1104509&r2=1104510&view=diff
==============================================================================
--- incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestDocIdSet.cs (original)
+++ incubator/lucene.net/branches/Lucene.Net_2_9_4g/test/core/Search/TestDocIdSet.cs Tue May
17 20:05:20 2011
@@ -133,32 +133,8 @@ namespace Lucene.Net.Search
 				return new AnonymousClassDocIdSetIterator(maxdoc, this);
 			}
 		}
-		private class AnonymousClassFilteredDocIdSet:FilteredDocIdSet
-		{
-			private void  InitBlock(TestDocIdSet enclosingInstance)
-			{
-				this.enclosingInstance = enclosingInstance;
-			}
-			private TestDocIdSet enclosingInstance;
-			public TestDocIdSet Enclosing_Instance
-			{
-				get
-				{
-					return enclosingInstance;
-				}
-				
-			}
-			internal AnonymousClassFilteredDocIdSet(TestDocIdSet enclosingInstance, Lucene.Net.Search.DocIdSet
Param1):base(Param1)
-			{
-				InitBlock(enclosingInstance);
-			}
-			// @Override
-			public /*protected internal*/ override bool Match(int docid)
-			{
-				return docid % 2 == 0; //validate only even docids
-			}
-		}
-		[Serializable]
+
+        [Serializable]
 		private class AnonymousClassFilter:Filter
 		{
 			public AnonymousClassFilter(TestDocIdSet enclosingInstance)
@@ -188,9 +164,12 @@ namespace Lucene.Net.Search
 		{
 			int maxdoc = 10;
 			DocIdSet innerSet = new AnonymousClassDocIdSet_Renamed_Class(maxdoc, this);
-			
-			
-			DocIdSet filteredSet = new AnonymousClassFilteredDocIdSet(this, innerSet);
+
+
+            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();



Mime
View raw message