Package org.apache.lucene.search
Class ConjunctionUtils
- java.lang.Object
-
- org.apache.lucene.search.ConjunctionUtils
-
public final class ConjunctionUtils extends Object
Helper methods for building conjunction iterators
-
-
Constructor Summary
Constructors Constructor Description ConjunctionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addIterator(DocIdSetIterator disi, List<DocIdSetIterator> allIterators, List<TwoPhaseIterator> twoPhaseIterators)
Given a DocIdSetIterator, find any sub-iterators or two-phase iterators and add them to the provided DocIdSetIterator and TwoPhaseIterator listsstatic void
addTwoPhaseIterator(TwoPhaseIterator twoPhaseIter, List<DocIdSetIterator> allIterators, List<TwoPhaseIterator> twoPhaseIterators)
Given a two-phase iterator, find any sub-iterators and add them to the provided DocIdSetIterator and TwoPhaseIterator listsstatic DocIdSetIterator
createConjunction(List<DocIdSetIterator> allIterators, List<TwoPhaseIterator> twoPhaseIterators)
Create a conjunction over the provided set of DocIdSetIterators and TwoPhaseIterators, using two-phase iterator where possible.static DocIdSetIterator
intersectIterators(List<? extends DocIdSetIterator> iterators)
Create a conjunction over the provided DocIdSetIterators.static DocIdSetIterator
intersectScorers(Collection<Scorer> scorers)
Create a conjunction over the providedScorer
s.
-
-
-
Method Detail
-
intersectScorers
public static DocIdSetIterator intersectScorers(Collection<Scorer> scorers)
Create a conjunction over the providedScorer
s. Note that the returnedDocIdSetIterator
might leverage two-phase iteration in which case it is possible to retrieve theTwoPhaseIterator
usingTwoPhaseIterator.unwrap(org.apache.lucene.search.DocIdSetIterator)
.
-
intersectIterators
public static DocIdSetIterator intersectIterators(List<? extends DocIdSetIterator> iterators)
Create a conjunction over the provided DocIdSetIterators. Note that the returnedDocIdSetIterator
might leverage two-phase iteration in which case it is possible to retrieve theTwoPhaseIterator
usingTwoPhaseIterator.unwrap(org.apache.lucene.search.DocIdSetIterator)
.
-
createConjunction
public static DocIdSetIterator createConjunction(List<DocIdSetIterator> allIterators, List<TwoPhaseIterator> twoPhaseIterators)
Create a conjunction over the provided set of DocIdSetIterators and TwoPhaseIterators, using two-phase iterator where possible. Note that the returnedDocIdSetIterator
might leverage two-phase iteration in which case it is possible to retrieve theTwoPhaseIterator
usingTwoPhaseIterator.unwrap(org.apache.lucene.search.DocIdSetIterator)
.- Parameters:
allIterators
- a list of DocIdSetIterators to combinetwoPhaseIterators
- a list of TwoPhaseIterators to combine
-
addTwoPhaseIterator
public static void addTwoPhaseIterator(TwoPhaseIterator twoPhaseIter, List<DocIdSetIterator> allIterators, List<TwoPhaseIterator> twoPhaseIterators)
Given a two-phase iterator, find any sub-iterators and add them to the provided DocIdSetIterator and TwoPhaseIterator lists
-
addIterator
public static void addIterator(DocIdSetIterator disi, List<DocIdSetIterator> allIterators, List<TwoPhaseIterator> twoPhaseIterators)
Given a DocIdSetIterator, find any sub-iterators or two-phase iterators and add them to the provided DocIdSetIterator and TwoPhaseIterator lists
-
-