public class PhraseQuery extends MultiTermQuery
Query.ForEachQueryNode
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)
Stores the query terms of the phrase query in the
given matching query terms structure.
|
void |
obtainQueryTerms(MatchingQueryTerms terms,
boolean required)
Stores the query terms of the phrase query in the
given matching query terms structure.
|
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
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)
obtainQueryTerms
in class MultiTermQuery
terms
- MatchingQueryTerms the structure that stores
the query terms for matching.public void obtainQueryTerms(MatchingQueryTerms terms, boolean required)
obtainQueryTerms
in class MultiTermQuery
terms
- MatchingQueryTerms the structure that stores
the query terms for matching.required
- boolean indicates whether the phrase is
required or not.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 4.0. Copyright © 2004-2014 University of Glasgow