public class PhraseQuery extends MultiTermQuery
Query.ForEachQueryNode, Query.QTPBuilder, Query.QueryTermsParameter
Modifier and Type | Field and Description |
---|---|
protected int |
proximityDistance
Indicates the distance, in number of blocks,
that the phrase terms can appear in a document.
|
prefix, suffix, v
Constructor and Description |
---|
PhraseQuery()
A default constructor that calls the constructor
of the super class.
|
PhraseQuery(int proxDistance)
Constructs a phrase query and sets the
proximity distance
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Deep copy this Query object
|
void |
getTermsOf(Class<? extends Query> c,
List<Query> alist,
boolean req)
Returns all the query terms, in subqueries that
are instances of a given class
|
boolean |
obtainControls(Set<String> allowed,
Map<String,String> controls)
This object cannot contain any controls, so this method will always return false.
|
void |
obtainQueryTerms(MatchingQueryTerms terms,
String field,
Boolean required,
Double weight) |
void |
obtainQueryTerms(Query.QueryTermsParameter parameters) |
void |
setProximityDistance(int prox)
Sets the allowed distance, in blocks, between
the phrase terms.
|
String |
toString()
Returns a string representation of the phrase query.
|
add, add, apply, applyTermPipeline, getNumberOfTerms, getTerms, obtainAllOf, parseTree, replace, setWeight
protected int proximityDistance
public PhraseQuery()
public PhraseQuery(int proxDistance)
proxDistance
- int the distance, in number
of blocks, that the phrase terms can appear
in a document.public Object clone()
clone
in class MultiTermQuery
public void setProximityDistance(int prox)
prox
- the allowed distance between the phrase terms.public String toString()
toString
in class MultiTermQuery
public void obtainQueryTerms(MatchingQueryTerms terms, String field, Boolean required, Double weight)
obtainQueryTerms
in class MultiTermQuery
public void obtainQueryTerms(Query.QueryTermsParameter parameters)
obtainQueryTerms
in class MultiTermQuery
public boolean obtainControls(Set<String> allowed, Map<String,String> controls)
obtainControls
in class MultiTermQuery
allowed
- The HashSet of control names that are allowed to be set.controls
- The Hashtable into which child objects much add
found controlspublic void getTermsOf(Class<? extends Query> c, List<Query> alist, boolean req)
getTermsOf
in class MultiTermQuery
c
- Class a class of queries.alist
- ArrayList the list of query terms.req
- boolean indicates whether the subqueries
are required or not.Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow