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
implements Query

CriteriaQuery

Author:
Rizwan Idrees, Mohsin Husen

Field Summary
protected  List<String> fields
           
protected  List<String> indices
           
protected  Pageable pageable
           
protected  Sort sort
           
protected  List<String> types
           
 
Fields inherited from interface org.springframework.data.elasticsearch.core.query.Query
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
 List<String> getIndices()
          Get Indices to be searched
 Pageable getPageable()
          Get page settings if defined
 Sort getSort()
           
 List<String> getTypes()
          Get types to be searched
<T extends Query>
T
setPageable(Pageable pageable)
          restrict result to entries on given page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.elasticsearch.core.query.Query
addFields, addIndices, addSort, addTypes, getFields, getIndices, getPageable, getSort, getTypes, setPageable
 

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
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:

Spring Data Elasticsearch

Copyright © 2013 BioMed Central. All Rights Reserved.