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,
List<NamedFilter> namedFilters,
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() |
List<NamedFilter> |
getNamedFilters()
Filters with associated names.
|
String |
getUserQuery() |
void |
setBoostsByQuery(List<BoostQuery> boostsByQuery) |
void |
setBoostsByValues(List<BoostByValue> boostsByValues) |
void |
setFilters(List<Query> filters) |
void |
setMain(Query main) |
clone, deepClone
public QueryDefinition(Query main, List<BoostByValue> boostsByValues, List<BoostQuery> boostsByQuery, String userQuery, List<Query> filters, List<NamedFilter> namedFilters, Query groupedQuery, List<Query> groupedFilters)
public 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 List<NamedFilter> getNamedFilters()
getFilters()
- they are used to narrow the base
result set and have no impact on scoring. Additionally however, filters in this list are paired with names that
allow them to be manipulated by other features. See FacetDomain.getExcludedFiltersByName()
for an example.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 set
This field is ignored with "hint.grouping.method=group".
public List<Query> getGroupedFilters()
getFilters()
for group details. Results.getGroup()
has to be set
This field is ignored with "hint.grouping.method=group".
public void setBoostsByQuery(List<BoostQuery> boostsByQuery)
public void addBoostByQuery(BoostQuery boostQuery)
public QueryDefinition clone()
clone
in class DslCloneable