Package org.terrier.matching.matchops
Class MultiTermOp
- java.lang.Object
-
- org.terrier.matching.matchops.Operator
-
- org.terrier.matching.matchops.MultiTermOp
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
- Direct Known Subclasses:
ANDQueryOp
,SynonymOp
public abstract class MultiTermOp extends Operator
this is an abstract operator, which implements common functionalities for operators that consist of multiple terms.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
logger
-
Fields inherited from class org.terrier.matching.matchops.Operator
IGNORE_LOW_IDF_TERMS
-
-
Constructor Summary
Constructors Constructor Description MultiTermOp(java.lang.String[] ts, boolean allRequired)
MultiTermOp(Operator[] _ts, boolean _allRequired)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static EntryStatistics
addStatistics(EntryStatistics[] entryStats)
merges several EntryStatistics for a single effective term simply by addingMultiTermOp
clone()
protected abstract IterablePosting
createFinalPostingIterator(java.util.List<IterablePosting> postings, java.util.List<EntryStatistics> pointers)
Operator[]
getConstituents()
MatchingEntry
getMatcher(MatchingQueryTerms.QueryTermProperties qtp, Index index, Lexicon<java.lang.String> lexicon, PostingIndex<Pointer> invertedIndex, CollectionStatistics collectionStatistics)
get an entry for matching for this query op.org.apache.commons.lang3.tuple.Pair<EntryStatistics,IterablePosting>
getPostingIterator(Index index)
get posting iterator for this query op.protected EntryStatistics
mergeStatistics(EntryStatistics[] entryStats, CollectionStatistics collStats)
-
-
-
Constructor Detail
-
MultiTermOp
public MultiTermOp(java.lang.String[] ts, boolean allRequired)
-
MultiTermOp
public MultiTermOp(Operator[] _ts, boolean _allRequired)
-
-
Method Detail
-
getConstituents
public Operator[] getConstituents()
-
addStatistics
public static EntryStatistics addStatistics(EntryStatistics[] entryStats)
merges several EntryStatistics for a single effective term simply by adding
-
mergeStatistics
protected EntryStatistics mergeStatistics(EntryStatistics[] entryStats, CollectionStatistics collStats)
-
createFinalPostingIterator
protected abstract IterablePosting createFinalPostingIterator(java.util.List<IterablePosting> postings, java.util.List<EntryStatistics> pointers) throws java.io.IOException
- Throws:
java.io.IOException
-
getPostingIterator
public org.apache.commons.lang3.tuple.Pair<EntryStatistics,IterablePosting> getPostingIterator(Index index) throws java.io.IOException
Description copied from class:Operator
get posting iterator for this query op.- Specified by:
getPostingIterator
in classOperator
- Returns:
- Pair, but Pair.of(null,null) if term not found
- Throws:
java.io.IOException
-
getMatcher
public MatchingEntry getMatcher(MatchingQueryTerms.QueryTermProperties qtp, Index index, Lexicon<java.lang.String> lexicon, PostingIndex<Pointer> invertedIndex, CollectionStatistics collectionStatistics) throws java.io.IOException
Description copied from class:Operator
get an entry for matching for this query op. calls getPostingIterator() internally- Specified by:
getMatcher
in classOperator
- Throws:
java.io.IOException
-
clone
public MultiTermOp clone()
-
-