Package org.terrier.matching.dsms
Class BooleanFallback
- java.lang.Object
- 
- org.terrier.matching.dsms.BooleanFallback
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- DocumentScoreModifier
 
 public class BooleanFallback extends java.lang.Object implements DocumentScoreModifier This class provides a boolean fallback document score modifier for matching. In other words, if there any of the retrieved documents contain all undecorated query terms (ie query terms without any operators), then we remove from the result set documents that do not contain all undecorated query terms. Otherwise, we do nothing.- Author:
- Vassilis Plachouras & Craig Macdonald
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static org.slf4j.Loggerlogger
 - 
Constructor SummaryConstructors Constructor Description BooleanFallback()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Creates the close of this objectprotected java.util.HashSet<java.lang.String>getMinusTerms(Query q)Builds a hashset containing all terms that are required NOT to be in the queryjava.lang.StringgetName()Returns the name of the modifier, which is BooleanFallback.booleanmodifyScores(Index index, MatchingQueryTerms queryTerms, ResultSet resultSet)Applies boolean fallback to the given result set.
 
- 
- 
- 
Method Detail- 
getMinusTermsprotected java.util.HashSet<java.lang.String> getMinusTerms(Query q) Builds a hashset containing all terms that are required NOT to be in the query- Parameters:
- q- The original query as was used to generate MatchingQueryTerms
- Returns:
- See above
 
 - 
modifyScorespublic boolean modifyScores(Index index, MatchingQueryTerms queryTerms, ResultSet resultSet) Applies boolean fallback to the given result set.- Specified by:
- modifyScoresin interface- DocumentScoreModifier
- Parameters:
- index- The data structures used for retrieval.
- queryTerms- the terms of the query.
- resultSet- the set of retrieved documents for the query.
- Returns:
- true if any scores have been altered
 
 - 
getNamepublic java.lang.String getName() Returns the name of the modifier, which is BooleanFallback.- Specified by:
- getNamein interface- DocumentScoreModifier
- Returns:
- the name of the modifier.
 
 - 
clonepublic java.lang.Object clone() Creates the close of this object- Specified by:
- clonein interface- DocumentScoreModifier
- Overrides:
- clonein class- java.lang.Object
 
 
- 
 
-