public class SimpleQuery extends Object implements Query, FilterQuery
Query that allows multiple options like pagination, grouping,...Query.OperatorDEFAULT_PAGE_SIZE| Constructor and Description |
|---|
SimpleQuery() |
SimpleQuery(Criteria criteria) |
SimpleQuery(Criteria criteria,
Pageable pageable) |
SimpleQuery(String queryString) |
SimpleQuery(String queryString,
Pageable pageable) |
| Modifier and Type | Method and Description |
|---|---|
<T extends SolrDataQuery> |
addCriteria(Criteria criteria)
Add an criteria to the query.
|
<T extends Query> |
addFilterQuery(FilterQuery filterQuery)
add query to filter results Corresponds to
fq in solr |
<T extends Query> |
addGroupByField(Field field)
Deprecated.
|
<T extends Query> |
addGroupByField(String fieldname)
Deprecated.
in favor of
GroupOptions |
<T extends Query> |
addProjectionOnField(Field field)
add given Field to those included in result.
|
<T extends Query> |
addProjectionOnField(String fieldname) |
<T extends Query> |
addProjectionOnFields(Field... fields) |
<T extends Query> |
addProjectionOnFields(String... fieldnames) |
<T extends Query> |
addSort(Sort sort)
Add
Sort to query |
static Query |
fromQuery(Query source) |
static <T extends SimpleQuery> |
fromQuery(Query source,
T destination) |
Criteria |
getCriteria() |
Query.Operator |
getDefaultOperator()
Get the specified default operator for query expressions, overriding the default operator specified in the
schema.xml file. |
String |
getDefType()
Get the default type of query, if one has been specified.
|
List<FilterQuery> |
getFilterQueries()
Get filter queries if defined
|
List<Field> |
getGroupByFields()
Deprecated.
|
GroupOptions |
getGroupOptions() |
Join |
getJoin() |
Long |
getOffset()
Get number of rows to skip.
|
Pageable |
getPageRequest()
Get page settings if defined.
|
List<Field> |
getProjectionOnFields()
Get projection fields if defined
|
String |
getRequestHandler() |
Integer |
getRows()
Get number of rows to fetch.
|
Sort |
getSort() |
SpellcheckOptions |
getSpellcheckOptions() |
StatsOptions |
getStatsOptions() |
Integer |
getTimeAllowed()
Return the time (in milliseconds) allowed for a search to finish
|
boolean |
hasDefaultOperatorDefined() |
void |
setDefaultOperator(Query.Operator operator)
Set the default operator
q.op for query expressions |
void |
setDefType(String defType)
Sets the default type to be used by the query.
|
<T extends Query> |
setGroupOptions(GroupOptions groupOptions)
Sets
GroupOptions for this Query. |
void |
setJoin(Join join)
Set values for join {@code !
|
<T extends Query> |
setOffset(Long offset)
Set the number of rows to skip.
|
<T extends Query> |
setPageRequest(Pageable pageable)
restrict result to entries on given page.
|
void |
setRequestHandler(String requestHandler) |
<T extends Query> |
setRows(Integer rows)
Set the number of rows to fetch.
|
<T extends Query> |
setSpellcheckOptions(SpellcheckOptions spellcheckOptions)
Set the
SpellcheckOptions to enable spellchecking. |
<T extends Query> |
setStatsOptions(StatsOptions statsOptions)
Set
StatsOptions for this Query. |
<T extends Query> |
setTimeAllowed(Integer timeAllowed)
The time in milliseconds allowed for a search to finish.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRequestHandler, setRequestHandleraddCriteria, getCriteria, getJoin, setJoinpublic SimpleQuery()
public SimpleQuery(Criteria criteria)
criteria - public SimpleQuery(String queryString)
queryString - public SimpleQuery(Criteria criteria, @Nullable Pageable pageable)
criteria - pageable - @Nullable public static <T extends SimpleQuery> T fromQuery(@Nullable Query source, @Nullable T destination)
public final <T extends Query> T addProjectionOnField(Field field)
Queryfl parameter in solr.addProjectionOnField in interface Querypublic final <T extends Query> T setPageRequest(Pageable pageable)
Querystart and row parameter in solrsetPageRequest in interface Querypublic <T extends Query> T setOffset(Long offset)
Querypublic <T extends Query> T setRows(Integer rows)
Query@Deprecated public final <T extends Query> T addGroupByField(Field field)
QueryaddGroupByField in interface Query@Deprecated public final <T extends Query> T addGroupByField(String fieldname)
GroupOptionsfieldname - must not be nullGroupOptionspublic final <T extends Query> T addSort(@Nullable Sort sort)
QuerySort to querypublic Pageable getPageRequest()
QuerygetPageRequest in interface Query@Nullable public Long getOffset()
Query@Nullable public Integer getRows()
Query@Deprecated public List<Field> getGroupByFields()
QuerygetGroupByFields in interface Querypublic List<Field> getProjectionOnFields()
QuerygetProjectionOnFields in interface Querypublic <T extends Query> T addFilterQuery(FilterQuery filterQuery)
Queryfq in solraddFilterQuery in interface Querypublic <T extends Query> T setTimeAllowed(Integer timeAllowed)
QuerysetTimeAllowed in interface Query@Nullable public Integer getTimeAllowed()
QuerygetTimeAllowed in interface Querypublic <T extends Query> T setGroupOptions(GroupOptions groupOptions)
QueryGroupOptions for this Query.setGroupOptions in interface Query@Nullable public GroupOptions getGroupOptions()
getGroupOptions in interface Query@Nullable public StatsOptions getStatsOptions()
getStatsOptions in interface QueryStatsOptions or null if not set.public <T extends Query> T setStatsOptions(StatsOptions statsOptions)
QueryStatsOptions for this Query.setStatsOptions in interface Querypublic List<FilterQuery> getFilterQueries()
QuerygetFilterQueries in interface Querypublic Query.Operator getDefaultOperator()
Queryschema.xml file.getDefaultOperator in interface Querypublic boolean hasDefaultOperatorDefined()
Operator#NONEpublic void setDefaultOperator(Query.Operator operator)
Queryq.op for query expressionssetDefaultOperator in interface Querypublic String getDefType()
QuerygetDefType in interface Querypublic void setDefType(String defType)
QuerysetDefType in interface Querypublic <T extends Query> T setSpellcheckOptions(SpellcheckOptions spellcheckOptions)
QuerySpellcheckOptions to enable spellchecking.setSpellcheckOptions in interface QueryspellcheckOptions - can be null.@Nullable public SpellcheckOptions getSpellcheckOptions()
getSpellcheckOptions in interface Querypublic final <T extends SolrDataQuery> T addCriteria(Criteria criteria)
criteria - must not be null.public void setJoin(Join join)
!join from=inner_id to=outer_idpublic void setRequestHandler(String requestHandler)
Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.