public interface SearchOperations
Modifier and Type | Method and Description |
---|---|
long |
count(Query query,
Class<?> clazz)
return number of elements found by given query
|
long |
count(Query query,
Class<?> clazz,
IndexCoordinates index)
return number of elements found by given query
|
default long |
count(Query query,
IndexCoordinates index)
Return number of elements found by given query.
|
default <T> AggregatedPage<T> |
moreLikeThis(MoreLikeThisQuery query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
search(MoreLikeThisQuery, Class, IndexCoordinates) . |
<T> List<SearchHits<T>> |
multiSearch(List<? extends Query> queries,
Class<T> clazz)
Execute the multi search query against elasticsearch and return result as
List of SearchHits . |
<T> List<SearchHits<T>> |
multiSearch(List<? extends Query> queries,
Class<T> clazz,
IndexCoordinates index)
Execute the multi search query against elasticsearch and return result as
List of SearchHits . |
List<SearchHits<?>> |
multiSearch(List<? extends Query> queries,
List<Class<?>> classes)
Execute the multi search query against elasticsearch and return result as
List of SearchHits . |
List<SearchHits<?>> |
multiSearch(List<? extends Query> queries,
List<Class<?>> classes,
IndexCoordinates index)
Execute the multi search query against elasticsearch and return result as
List of SearchHits . |
default List<String> |
queryForIds(Query query,
Class<?> clazz,
IndexCoordinates index)
Deprecated.
since 4.0 use
search(Query, Class, IndexCoordinates) and map the results. |
default <T> List<List<T>> |
queryForList(List<Query> queries,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
multiSearch(List, Class, IndexCoordinates) . |
default List<List<?>> |
queryForList(List<Query> queries,
List<Class<?>> classes,
IndexCoordinates index)
Deprecated.
since 4.0, use
multiSearch(List, List, IndexCoordinates) . |
default <T> List<T> |
queryForList(Query query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
search(Query, Class, IndexCoordinates) . |
default <T> T |
queryForObject(Query query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
searchOne(Query, Class, IndexCoordinates) . |
default <T> List<Page<T>> |
queryForPage(List<? extends Query> queries,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
multiSearch(List, Class, IndexCoordinates) . |
default List<AggregatedPage<?>> |
queryForPage(List<? extends Query> queries,
List<Class<?>> classes,
IndexCoordinates index)
Deprecated.
since 4.0, use
multiSearch(List, List, IndexCoordinates) . |
default <T> AggregatedPage<T> |
queryForPage(Query query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
search(Query, Class, IndexCoordinates) . |
<T> SearchHits<T> |
search(MoreLikeThisQuery query,
Class<T> clazz)
more like this query to search for documents that are "like" a specific document.
|
<T> SearchHits<T> |
search(MoreLikeThisQuery query,
Class<T> clazz,
IndexCoordinates index)
more like this query to search for documents that are "like" a specific document.
|
<T> SearchHits<T> |
search(Query query,
Class<T> clazz)
Execute the criteria query against elasticsearch and return result as
SearchHits |
<T> SearchHits<T> |
search(Query query,
Class<T> clazz,
IndexCoordinates index)
Execute the criteria query against elasticsearch and return result as
SearchHits |
<T> SearchHitsIterator<T> |
searchForStream(Query query,
Class<T> clazz)
Executes the given
Query against elasticsearch and return result as SearchHitsIterator . |
<T> SearchHitsIterator<T> |
searchForStream(Query query,
Class<T> clazz,
IndexCoordinates index)
Executes the given
Query against elasticsearch and return result as SearchHitsIterator . |
default <T> SearchHit<T> |
searchOne(Query query,
Class<T> clazz)
Execute the query against elasticsearch and return the first returned object.
|
default <T> SearchHit<T> |
searchOne(Query query,
Class<T> clazz,
IndexCoordinates index)
Execute the query against elasticsearch and return the first returned object.
|
<T> CloseableIterator<T> |
stream(Query query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
searchForStream(Query, Class, IndexCoordinates) . |
org.elasticsearch.action.search.SearchResponse |
suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
Class<?> clazz)
Does a suggest query
|
org.elasticsearch.action.search.SearchResponse |
suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
IndexCoordinates index)
Does a suggest query
|
default long count(Query query, IndexCoordinates index)
query
- the query to executeindex
- the index to run the query againstlong count(Query query, Class<?> clazz)
query
- the query to executeclazz
- the entity clazz used for property mapping and index name extractionlong count(Query query, @Nullable Class<?> clazz, IndexCoordinates index)
query
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against@Deprecated default <T> T queryForObject(Query query, Class<T> clazz, IndexCoordinates index)
searchOne(Query, Class, IndexCoordinates)
.query
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against@Deprecated default <T> AggregatedPage<T> queryForPage(Query query, Class<T> clazz, IndexCoordinates index)
search(Query, Class, IndexCoordinates)
.Page
.query
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against@Deprecated default <T> List<Page<T>> queryForPage(List<? extends Query> queries, Class<T> clazz, IndexCoordinates index)
multiSearch(List, Class, IndexCoordinates)
.queries
- the queriesclazz
- the entity clazz used for property mappingindex
- the index to run the query against@Deprecated default List<AggregatedPage<?>> queryForPage(List<? extends Query> queries, List<Class<?>> classes, IndexCoordinates index)
multiSearch(List, List, IndexCoordinates)
.queries
- the queriesclasses
- the entity classes used for the queriesindex
- the index to run the query against@Deprecated <T> CloseableIterator<T> stream(Query query, Class<T> clazz, IndexCoordinates index)
searchForStream(Query, Class, IndexCoordinates)
.Query
against elasticsearch and return result as CloseableIterator
.
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query againstCloseableIterator
that wraps an Elasticsearch scroll context that needs to be closed. The
try-with-resources construct should be used to ensure that the close method is invoked after the operations
are completed.@Deprecated default <T> List<T> queryForList(Query query, Class<T> clazz, IndexCoordinates index)
search(Query, Class, IndexCoordinates)
.List
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against@Deprecated default <T> List<List<T>> queryForList(List<Query> queries, Class<T> clazz, IndexCoordinates index)
multiSearch(List, Class, IndexCoordinates)
.List
T
- element return typequeries
- the queries to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against@Deprecated default List<List<?>> queryForList(List<Query> queries, List<Class<?>> classes, IndexCoordinates index)
multiSearch(List, List, IndexCoordinates)
.List
queries
- the queries to executeclasses
- the entity classes used for property mappingindex
- the index to run the query against@Deprecated default List<String> queryForIds(Query query, Class<?> clazz, IndexCoordinates index)
search(Query, Class, IndexCoordinates)
and map the results.query
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against@Deprecated default <T> AggregatedPage<T> moreLikeThis(MoreLikeThisQuery query, Class<T> clazz, IndexCoordinates index)
search(MoreLikeThisQuery, Class, IndexCoordinates)
.T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query againstorg.elasticsearch.action.search.SearchResponse suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, Class<?> clazz)
suggestion
- the querythe
- entity classorg.elasticsearch.action.search.SearchResponse suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, IndexCoordinates index)
suggestion
- the queryindex
- the index to run the query against@Nullable default <T> SearchHit<T> searchOne(Query query, Class<T> clazz)
query
- the query to executeclazz
- the entity clazz used for property mapping and indexname extraction@Nullable default <T> SearchHit<T> searchOne(Query query, Class<T> clazz, IndexCoordinates index)
query
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against<T> List<SearchHits<T>> multiSearch(List<? extends Query> queries, Class<T> clazz)
List
of SearchHits
.T
- element return typequeries
- the queries to executeclazz
- the entity clazz<T> List<SearchHits<T>> multiSearch(List<? extends Query> queries, Class<T> clazz, IndexCoordinates index)
List
of SearchHits
.T
- element return typequeries
- the queries to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query againstList<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes)
List
of SearchHits
.queries
- the queries to executeclasses
- the entity classesList<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes, IndexCoordinates index)
List
of SearchHits
.queries
- the queries to executeclasses
- the entity classes used for property mappingindex
- the index to run the query against<T> SearchHits<T> search(Query query, Class<T> clazz)
SearchHits
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mapping and index name extraction<T> SearchHits<T> search(Query query, Class<T> clazz, IndexCoordinates index)
SearchHits
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against<T> SearchHits<T> search(MoreLikeThisQuery query, Class<T> clazz)
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mapping and index name extraction<T> SearchHits<T> search(MoreLikeThisQuery query, Class<T> clazz, IndexCoordinates index)
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query against<T> SearchHitsIterator<T> searchForStream(Query query, Class<T> clazz)
Query
against elasticsearch and return result as SearchHitsIterator
.
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mapping and index name extractionSearchHitsIterator
that wraps an Elasticsearch scroll context that needs to be closed. The
try-with-resources construct should be used to ensure that the close method is invoked after the operations
are completed.<T> SearchHitsIterator<T> searchForStream(Query query, Class<T> clazz, IndexCoordinates index)
Query
against elasticsearch and return result as SearchHitsIterator
.
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query againstSearchHitsIterator
that wraps an Elasticsearch scroll context that needs to be closed. The
try-with-resources construct should be used to ensure that the close method is invoked after the operations
are completed.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.