Inheritance: Lucene.Net.Search.DocIdSet
Ejemplo n.º 1
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;
        }
Ejemplo n.º 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);
        }