public class QueryDefinition extends DslCloneable
getUserQuery() and getMain():
If getUserQuery() is set and getMain() is not,
getMain() will be set to TextQuery with getUserQuery() as a value.
If getUserQuery() is set and getMain() is set, assumption is that
getMain() query contains some TextQuery(s) without a value
which will default to getUserQuery() as a value.
Expectation is for at least one of getUserQuery() and getMain() fields
to be populated
getGroupedQuery() and getGroupedFilters() are used in relation
with Results.getGroup(). Expectation is for Results.getGroup() to be set if any of these queries are set.
Note: keep in mind that not all of the queries that could be specified in DslRequest located here.
Some are specific to a particular part of request and located there (for example "sort by" queries)
| Constructor and Description |
|---|
QueryDefinition(Query main,
List<BoostByValue> boostsByValues,
List<BoostQuery> boostsByQuery,
String userQuery,
List<Query> filters,
Query groupedQuery,
List<Query> groupedFilters) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBoostByQuery(BoostQuery boostQuery) |
void |
addBoostByValues(BoostByValue boostByValues) |
void |
addFilter(Query filter) |
QueryDefinition |
clone() |
List<BoostQuery> |
getBoostsByQuery() |
List<BoostByValue> |
getBoostsByValues() |
List<Query> |
getFilters() |
List<Query> |
getGroupedFilters() |
Query |
getGroupedQuery() |
Query |
getMain() |
String |
getUserQuery() |
void |
setBoostsByQuery(List<BoostQuery> boostsByQuery) |
void |
setBoostsByValues(List<BoostByValue> boostsByValues) |
void |
setFilters(List<Query> filters) |
void |
setMain(Query main) |
clone, deepClonepublic Query getMain()
TextQuery with getUserQuery() valuepublic void setMain(Query main)
public List<BoostByValue> getBoostsByValues()
getBoostsByQuery() and will be added to getMain()
to influence the score. Boosts by query and value have no impact on the result set.public List<BoostQuery> getBoostsByQuery()
getBoostsByValues() and will be added to getMain()
to influence the score. Boosts by query and value have no impact on the result set.public String getUserQuery()
getMain()public List<Query> getFilters()
public void addFilter(Query filter)
public void setBoostsByValues(List<BoostByValue> boostsByValues)
public void addBoostByValues(BoostByValue boostByValues)
public Query getGroupedQuery()
getMain() for group details. Results.getGroup() has to be setpublic List<Query> getGroupedFilters()
getFilters() for group details. Results.getGroup() has to be setpublic void setBoostsByQuery(List<BoostQuery> boostsByQuery)
public void addBoostByQuery(BoostQuery boostQuery)
public QueryDefinition clone()
clone in class DslCloneable