Inheritance: Lucene.Net.Search.DocIdSet
        public override DocIdSet GetDocIdSet(IndexReader reader)
        {
            if (chainedFilters.Count == 0)
                {
                    throw new AssertionFailure("ChainedFilter has no filters to chain for");
                }

                // Create HashSet of first filter's contents
                HashSet<int> result = DocIdSetToHashSet(chainedFilters[0].GetDocIdSet(reader));

                // For each remaining filter, fill another HashSet and intersect it with the first.
                for (int i = 1; i < chainedFilters.Count; i++)
                {
                    var nextSet = DocIdSetToHashSet(chainedFilters[i].GetDocIdSet(reader));
                    result.IntersectWith(nextSet);
                }

                DocIdSet resultDocIds = new EnumerableBasedDocIdSet(result);
                return resultDocIds;
        }
Exemple #2
0
        public override DocIdSet GetDocIdSet(IndexReader reader)
        {
            if (chainedFilters.Count == 0)
            {
                throw new AssertionFailure("ChainedFilter has no filters to chain for");
            }

            // Create HashSet of first filter's contents
            HashSet <int> result = DocIdSetToHashSet(chainedFilters[0].GetDocIdSet(reader));

            // For each remaining filter, fill another HashSet and intersect it with the first.
            for (int i = 1; i < chainedFilters.Count; i++)
            {
                var nextSet = DocIdSetToHashSet(chainedFilters[i].GetDocIdSet(reader));
                result.IntersectWith(nextSet);
            }

            DocIdSet resultDocIds = new EnumerableBasedDocIdSet(result);

            return(resultDocIds);
        }