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, replaceprotected 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 MultiTermQuerypublic void setProximityDistance(int prox)
prox - the allowed distance between the phrase terms.public String toString()
toString in class MultiTermQuerypublic void obtainQueryTerms(MatchingQueryTerms terms)
obtainQueryTerms in class MultiTermQueryterms - MatchingQueryTerms the structure that stores
the query terms for matching.public void obtainQueryTerms(MatchingQueryTerms terms, boolean required)
obtainQueryTerms in class MultiTermQueryterms - 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 MultiTermQueryallowed - 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 MultiTermQueryc - 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 Platform4.1. Copyright © 2004-2015, University of Glasgow