Interface Query
- All Superinterfaces:
SolrDataQuery
- All Known Subinterfaces:
FacetAndHighlightQuery,FacetQuery,HighlightQuery
- All Known Implementing Classes:
AbstractFacetAndHighlightQueryDecorator,AbstractFacetQueryDecorator,AbstractHighlightQueryDecorator,AbstractQueryDecorator,SimpleFacetAndHighlightQuery,SimpleFacetQuery,SimpleHighlightQuery,SimpleQuery
A Query that can be translated into a solr understandable Query.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<T extends Query>
TaddFilterQuery(FilterQuery query) add query to filter results Corresponds tofqin solr<T extends Query>
TaddGroupByField(Field field) add the given field to those used for grouping result Corresponds to '' in solr<T extends Query>
TaddProjectionOnField(Field field) add given Field to those included in result.<T extends Query>
TaddSort(org.springframework.data.domain.Sort sort) AddSortto querystatic Queryall()Create a newQuerymatching all documents.Get the specified default operator for query expressions, overriding the default operator specified in theschema.xmlfile.Get the default type of query, if one has been specified.Get filter queries if definedGet group by fields if definedGet number of rows to skip.org.springframework.data.domain.PageableDeprecated.since 1.3.Get projection fields if definedReturns the request handler.getRows()Get number of rows to fetch.org.springframework.data.domain.SortgetSort()Return the time (in milliseconds) allowed for a search to finishdefault <T extends Query>
TShortcut foraddProjectionOnField(Field.of("*"))to project all known fields.static QueryCreate a newQueryform the given queryString.static QueryvoidsetDefaultOperator(Query.Operator operator) Set the default operatorq.opfor query expressionsvoidsetDefType(String defType) Sets the default type to be used by the query.<T extends Query>
TsetGroupOptions(GroupOptions groupOptions) SetsGroupOptionsfor thisQuery.<T extends Query>
TSet the number of rows to skip.<T extends Query>
TsetPageRequest(org.springframework.data.domain.Pageable pageable) restrict result to entries on given page.voidsetRequestHandler(String requestHandler) Sets the request handler.<T extends Query>
TSet the number of rows to fetch.<T extends Query>
TsetSpellcheckOptions(SpellcheckOptions spellcheckOptions) Set theSpellcheckOptionsto enable spellchecking.<T extends Query>
TsetStatsOptions(StatsOptions statsOptions) SetStatsOptionsfor thisQuery.<T extends Query>
TsetTimeAllowed(Integer timeAllowed) The time in milliseconds allowed for a search to finish.Methods inherited from interface org.springframework.data.solr.core.query.SolrDataQuery
addCriteria, getCriteria, getJoin, setJoin
-
Field Details
-
DEFAULT_PAGE_SIZE
static final int DEFAULT_PAGE_SIZE- See Also:
-
-
Method Details
-
addProjectionOnField
add given Field to those included in result. Corresponds to theflparameter in solr.- Parameters:
field-- Returns:
-
projectAllFields
Shortcut foraddProjectionOnField(Field.of("*"))to project all known fields.- Type Parameters:
T-- Returns:
- this
- Since:
- 4.1
-
setPageRequest
restrict result to entries on given page. Corresponds to thestartandrowparameter in solr- Parameters:
pageable-- Returns:
-
setOffset
Set the number of rows to skip.- Parameters:
offset-- Returns:
- Since:
- 1.3
-
setRows
Set the number of rows to fetch.- Parameters:
rows-- Returns:
- Since:
- 1.3
-
addGroupByField
add the given field to those used for grouping result Corresponds to '' in solr- Parameters:
field-- Returns:
-
addFilterQuery
add query to filter results Corresponds tofqin solr- Parameters:
query-- Returns:
-
setTimeAllowed
The time in milliseconds allowed for a search to finish. Values<= 0mean no time restriction.- Parameters:
timeAllowed-- Returns:
-
getFilterQueries
List<FilterQuery> getFilterQueries()Get filter queries if defined- Returns:
-
getPageRequest
Deprecated.since 1.3. Will be removed in 1.4. Please usegetOffset()andgetRows()instead.Get page settings if defined.- Returns:
-
getOffset
Get number of rows to skip.- Since:
- 1.3
-
getRows
Get number of rows to fetch.- Returns:
- Since:
- 1.3
-
getGroupByFields
Get group by fields if defined- Returns:
-
getProjectionOnFields
Get projection fields if defined- Returns:
-
addSort
AddSortto query- Parameters:
sort-- Returns:
-
getSort
@Nullable org.springframework.data.domain.Sort getSort()- Returns:
- null if not set
-
getTimeAllowed
Return the time (in milliseconds) allowed for a search to finish- Returns:
-
setDefaultOperator
Set the default operatorq.opfor query expressions -
getDefaultOperator
Get the specified default operator for query expressions, overriding the default operator specified in theschema.xmlfile.- Returns:
-
getDefType
Get the default type of query, if one has been specified. Overrides the default type specified in the solrconfig.xml file.- Returns:
-
setDefType
Sets the default type to be used by the query. -
getRequestHandler
Returns the request handler. -
setRequestHandler
Sets the request handler. -
setGroupOptions
SetsGroupOptionsfor thisQuery.- Parameters:
groupOptions-- Returns:
-
getGroupOptions
- Returns:
- group options
-
setStatsOptions
SetStatsOptionsfor thisQuery.- Parameters:
statsOptions-- Returns:
- Since:
- 1.4
-
getStatsOptions
- Returns:
StatsOptionsor null if not set.- Since:
- 1.4
-
setSpellcheckOptions
Set theSpellcheckOptionsto enable spellchecking.- Parameters:
spellcheckOptions- can be null.- Returns:
- never null.
- Since:
- 2.1
-
getSpellcheckOptions
- Returns:
- null if not set.
- Since:
- 2.1
-
all
Create a newQuerymatching all documents.- Returns:
- new instance of
Query. - Since:
- 4.1
-
query
- Parameters:
criteria- must not be null.- Returns:
- new instance of
Query. - Since:
- 4.1
-
query
Create a newQueryform the given queryString.- Parameters:
queryString- must not be null.- Returns:
- new instance of
Query. - Since:
- 4.1
-