Spring Data Solr

org.springframework.data.solr.core.query
Interface Query

All Superinterfaces:
SolrDataQuery
All Known Subinterfaces:
FacetQuery, HighlightQuery
All Known Implementing Classes:
SimpleFacetQuery, SimpleHighlightQuery, SimpleQuery

public interface Query
extends SolrDataQuery

A Query that can be translated into a solr understandable Query.

Author:
Christoph Strobl, Rosty Kerei, Luke Corpe, Andrey Paramonov

Nested Class Summary
static class Query.Operator
          Operator to be used for q.op
 
Field Summary
static int DEFAULT_PAGE_SIZE
           
 
Method Summary
<T extends Query>
T
addFilterQuery(FilterQuery query)
          add query to filter results Corresponds to fq in solr
<T extends Query>
T
addGroupByField(Field field)
          add the given field to those used for grouping result Corresponds to '' in solr
<T extends Query>
T
addProjectionOnField(Field field)
          add given Field to those included in result.
<T extends Query>
T
addSort(Sort sort)
          Add Sort to query
 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()
          Get group by fields if defined
 Pageable getPageRequest()
          Get page settings if defined
 List<Field> getProjectionOnFields()
          Get projection fields if defined
 String getRequestHandler()
          Returns the request handler.
 Sort getSort()
           
 Integer getTimeAllowed()
          Return the time (in milliseconds) allowed for a search to finish
 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>
T
setPageRequest(Pageable pageable)
          restrict result to entries on given page.
 void setRequestHandler(String requestHandler)
          Sets the request handler.
<T extends Query>
T
setTimeAllowed(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 Detail

DEFAULT_PAGE_SIZE

static final int DEFAULT_PAGE_SIZE
See Also:
Constant Field Values
Method Detail

addProjectionOnField

<T extends Query> T addProjectionOnField(Field field)
add given Field to those included in result. Corresponds to the fl parameter in solr.

Parameters:
field -
Returns:

setPageRequest

<T extends Query> T setPageRequest(Pageable pageable)
restrict result to entries on given page. Corresponds to the start and row parameter in solr

Parameters:
pageable -
Returns:

addGroupByField

<T extends Query> T addGroupByField(Field field)
add the given field to those used for grouping result Corresponds to '' in solr

Parameters:
field -
Returns:

addFilterQuery

<T extends Query> T addFilterQuery(FilterQuery query)
add query to filter results Corresponds to fq in solr

Parameters:
query -
Returns:

setTimeAllowed

<T extends Query> T setTimeAllowed(Integer timeAllowed)
The time in milliseconds allowed for a search to finish. Values <= 0 mean no time restriction.

Parameters:
timeAllowed -
Returns:

getFilterQueries

List<FilterQuery> getFilterQueries()
Get filter queries if defined

Returns:

getPageRequest

Pageable getPageRequest()
Get page settings if defined

Returns:

getGroupByFields

List<Field> getGroupByFields()
Get group by fields if defined

Returns:

getProjectionOnFields

List<Field> getProjectionOnFields()
Get projection fields if defined

Returns:

addSort

<T extends Query> T addSort(Sort sort)
Add Sort to query

Parameters:
sort -
Returns:

getSort

Sort getSort()
Returns:
null if not set

getTimeAllowed

Integer getTimeAllowed()
Return the time (in milliseconds) allowed for a search to finish

Returns:

setDefaultOperator

void setDefaultOperator(Query.Operator operator)
Set the default operator q.op for query expressions


getDefaultOperator

Query.Operator getDefaultOperator()
Get the specified default operator for query expressions, overriding the default operator specified in the schema.xml file.

Returns:

getDefType

String getDefType()
Get the default type of query, if one has been specified. Overrides the default type specified in the solrconfig.xml file.

Returns:

setDefType

void setDefType(String defType)
Sets the default type to be used by the query.


getRequestHandler

String getRequestHandler()
Returns the request handler.


setRequestHandler

void setRequestHandler(String requestHandler)
Sets the request handler.


Spring Data Solr

Copyright © 2011-2014-2014 Pivotal. All Rights Reserved.