public class MultiTermQuery extends Query
Query.ForEachQueryNode
Modifier and Type | Field and Description |
---|---|
protected String |
prefix |
protected String |
suffix |
protected ArrayList<Query> |
v
A list for holding the sub-queries.
|
Constructor and Description |
---|
MultiTermQuery()
A default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Query query)
Adds a subquery to this query.
|
void |
add(String term)
Adds a single query term to the query.
|
void |
apply(Query.ForEachQueryNode processor)
Apply the specified processor to this node.
|
boolean |
applyTermPipeline(TermPipelineAccessor tpa)
Applies the given term pipeline to the query terms
and sub-queries that construct this query.
|
Object |
clone()
Deep copy this Query object
|
int |
getNumberOfTerms()
Returns the number of terms, or subqueries.
|
protected void |
getTerms(List<Query> alist)
Adds all the subqueries and single-term queries to
a given array list.
|
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
|
void |
obtainAllOf(Class<? extends Query> c,
List<Query> a)
Returns all the queries of the specified class
|
boolean |
obtainControls(Set<String> allowed,
Map<String,String> controls)
Checks all child objects to see if they are FieldQuery objects, they are
each called to see if the are controls.
|
void |
obtainQueryTerms(MatchingQueryTerms terms)
Prepares the query for matching by transforming
the query objects to a set of query terms.
|
void |
obtainQueryTerms(MatchingQueryTerms terms,
boolean required)
Prepares the query for matching by transforming
the query objects to a set of query terms.
|
String |
parseTree()
Returns the parse tree for the query as a string
|
void |
replace(Query childNode,
Query replacement)
Replace query node
|
String |
toString()
Returns a string representation of the query.
|
public int getNumberOfTerms()
public void add(String term)
term
- String the query term.public void add(Query query)
query
- Query a subquery.public String toString()
public boolean applyTermPipeline(TermPipelineAccessor tpa)
applyTermPipeline
in class Query
tpa
- TermPipelineAccessor the object that gives access
to a term pipeline.public void obtainQueryTerms(MatchingQueryTerms terms)
obtainQueryTerms
in class Query
terms
- MatchingQueryTerms the object which holds the
query terms and their modifiers.public void obtainQueryTerms(MatchingQueryTerms terms, boolean required)
obtainQueryTerms
in class Query
terms
- MatchingQueryTerms the object which holds the
query terms and their modifiers.required
- boolean indicates whether the field query
is required or not.protected void getTerms(List<Query> alist)
public boolean obtainControls(Set<String> allowed, Map<String,String> controls)
obtainControls
in class Query
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 Query
c
- Class a class of queries.alist
- ArrayList the list of query terms.req
- boolean indicates whether the subqueries
are required or not.public void replace(Query childNode, Query replacement)
childNode
- replacement
- public void obtainAllOf(Class<? extends Query> c, List<Query> a)
Query
obtainAllOf
in class Query
public void apply(Query.ForEachQueryNode processor)
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow