Package org.terrier.querying.parser
Class DisjunctiveQuery
- java.lang.Object
-
- org.terrier.querying.parser.Query
-
- org.terrier.querying.parser.MultiTermQuery
-
- org.terrier.querying.parser.DisjunctiveQuery
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class DisjunctiveQuery extends MultiTermQuery
Models a disjunctive choice in single term queries in a query.- Author:
- Craig Macdonald
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.terrier.querying.parser.Query
Query.ForEachQueryNode, Query.QTPBuilder, Query.QueryTermsParameter
-
-
Constructor Summary
Constructors Constructor Description DisjunctiveQuery()
default constructorDisjunctiveQuery(java.lang.String[] alternatives)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getWeight()
Returns the weight of the disjunctive "term".void
obtainAllOf(java.lang.Class<? extends Query> c, java.util.List<Query> a)
Returns all the queries of the specified classvoid
obtainQueryTerms(MatchingQueryTerms terms, java.lang.String field, java.lang.Boolean required, java.lang.Double weight)
void
obtainQueryTerms(Query.QueryTermsParameter parameters)
void
resetActive()
reset active indexvoid
setActive(int _activeIndex)
set active indexvoid
setWeight(double w)
Sets the weight of the disjunctive "term".java.lang.String
toString()
Returns a string representation of the query.-
Methods inherited from class org.terrier.querying.parser.MultiTermQuery
add, add, apply, applyTermPipeline, clone, getNumberOfTerms, getTerms, getTermsOf, obtainControls, parseTree, replace
-
-
-
-
Method Detail
-
setWeight
public void setWeight(double w)
Sets the weight of the disjunctive "term".- Overrides:
setWeight
in classMultiTermQuery
- Parameters:
w
- double the weight of the disjunctive "term".
-
getWeight
public double getWeight()
Returns the weight of the disjunctive "term".- Returns:
- double the weight of the disjunctive "term".
-
resetActive
public void resetActive()
reset active index
-
setActive
public void setActive(int _activeIndex)
set active index- Parameters:
_activeIndex
-
-
obtainQueryTerms
public void obtainQueryTerms(MatchingQueryTerms terms, java.lang.String field, java.lang.Boolean required, java.lang.Double weight)
- Overrides:
obtainQueryTerms
in classMultiTermQuery
-
obtainQueryTerms
public void obtainQueryTerms(Query.QueryTermsParameter parameters)
- Overrides:
obtainQueryTerms
in classMultiTermQuery
-
obtainAllOf
public void obtainAllOf(java.lang.Class<? extends Query> c, java.util.List<Query> a)
Description copied from class:Query
Returns all the queries of the specified class- Overrides:
obtainAllOf
in classMultiTermQuery
-
toString
public java.lang.String toString()
Description copied from class:MultiTermQuery
Returns a string representation of the query.- Overrides:
toString
in classMultiTermQuery
- Returns:
- String the string of this query.
-
-