Spring Data Elasticsearch

org.springframework.data.elasticsearch.core.query
Class CriteriaQuery

java.lang.Object
  extended by org.springframework.data.elasticsearch.core.query.CriteriaQuery
All Implemented Interfaces:
Query

public class CriteriaQuery
extends Object

CriteriaQuery

Author:
Rizwan Idrees, Mohsin Husen

Field Summary
protected  List<String> fields
           
protected  Collection<String> ids
           
protected  List<String> indices
           
protected  float minScore
           
protected  Pageable pageable
           
protected  String route
           
protected  org.elasticsearch.action.search.SearchType searchType
           
protected  Sort sort
           
protected  List<String> types
           
 
Fields inherited from interface org.springframework.data.elasticsearch.core.query.Query
DEFAULT_PAGE, DEFAULT_PAGE_SIZE
 
Constructor Summary
CriteriaQuery(Criteria criteria)
           
CriteriaQuery(Criteria criteria, Pageable pageable)
           
 
Method Summary
<T extends CriteriaQuery>
T
addCriteria(Criteria criteria)
           
 void addFields(String... fields)
          Add fields to be added as part of search request
 void addIndices(String... indices)
          Add Indices to be added as part of search request
<T extends Query>
T
addSort(Sort sort)
          Add Sort to query
 void addTypes(String... types)
          Add types to be searched
static Query fromQuery(CriteriaQuery source)
           
static
<T extends CriteriaQuery>
T
fromQuery(CriteriaQuery source, T destination)
           
 Criteria getCriteria()
           
 List<String> getFields()
          Get fields to be returned as part of search request
 Collection<String> getIds()
          Get Ids
 List<String> getIndices()
          Get Indices to be searched
 float getMinScore()
          Get minimum score
 Pageable getPageable()
          Get page settings if defined
 String getRoute()
          Get route
 org.elasticsearch.action.search.SearchType getSearchType()
          Type of search
 Sort getSort()
           
 List<String> getTypes()
          Get types to be searched
 void setIds(Collection<String> ids)
           
 void setMinScore(float minScore)
           
<T extends Query>
T
setPageable(Pageable pageable)
          restrict result to entries on given page.
 void setRoute(String route)
           
 void setSearchType(org.elasticsearch.action.search.SearchType searchType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageable

protected Pageable pageable

sort

protected Sort sort

indices

protected List<String> indices

types

protected List<String> types

fields

protected List<String> fields

minScore

protected float minScore

ids

protected Collection<String> ids

route

protected String route

searchType

protected org.elasticsearch.action.search.SearchType searchType
Constructor Detail

CriteriaQuery

public CriteriaQuery(Criteria criteria)

CriteriaQuery

public CriteriaQuery(Criteria criteria,
                     Pageable pageable)
Method Detail

fromQuery

public static final Query fromQuery(CriteriaQuery source)

fromQuery

public static <T extends CriteriaQuery> T fromQuery(CriteriaQuery source,
                                                    T destination)

addCriteria

public final <T extends CriteriaQuery> T addCriteria(Criteria criteria)

getCriteria

public Criteria getCriteria()

getSort

public Sort getSort()
Specified by:
getSort in interface Query
Returns:
null if not set

getPageable

public Pageable getPageable()
Description copied from interface: Query
Get page settings if defined

Specified by:
getPageable in interface Query
Returns:

setPageable

public final <T extends Query> T setPageable(Pageable pageable)
Description copied from interface: Query
restrict result to entries on given page. Corresponds to the 'start' and 'rows' parameter in elasticsearch

Specified by:
setPageable in interface Query
Returns:

addFields

public void addFields(String... fields)
Description copied from interface: Query
Add fields to be added as part of search request

Specified by:
addFields in interface Query

getFields

public List<String> getFields()
Description copied from interface: Query
Get fields to be returned as part of search request

Specified by:
getFields in interface Query
Returns:

getIndices

public List<String> getIndices()
Description copied from interface: Query
Get Indices to be searched

Specified by:
getIndices in interface Query
Returns:

addIndices

public void addIndices(String... indices)
Description copied from interface: Query
Add Indices to be added as part of search request

Specified by:
addIndices in interface Query

addTypes

public void addTypes(String... types)
Description copied from interface: Query
Add types to be searched

Specified by:
addTypes in interface Query

getTypes

public List<String> getTypes()
Description copied from interface: Query
Get types to be searched

Specified by:
getTypes in interface Query
Returns:

addSort

public final <T extends Query> T addSort(Sort sort)
Description copied from interface: Query
Add Sort to query

Specified by:
addSort in interface Query
Returns:

getMinScore

public float getMinScore()
Description copied from interface: Query
Get minimum score

Specified by:
getMinScore in interface Query
Returns:

setMinScore

public void setMinScore(float minScore)

getIds

public Collection<String> getIds()
Description copied from interface: Query
Get Ids

Specified by:
getIds in interface Query
Returns:

setIds

public void setIds(Collection<String> ids)

getRoute

public String getRoute()
Description copied from interface: Query
Get route

Specified by:
getRoute in interface Query
Returns:

setRoute

public void setRoute(String route)

setSearchType

public void setSearchType(org.elasticsearch.action.search.SearchType searchType)

getSearchType

public org.elasticsearch.action.search.SearchType getSearchType()
Description copied from interface: Query
Type of search

Specified by:
getSearchType in interface Query
Returns:

Spring Data Elasticsearch

Copyright © 2011-2014-2014 Pivotal Software, Inc.. All Rights Reserved.