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.
|
Query |
idsQuery(List<String> ids)
Creates a
Query to find get all documents with given ids. |
Query |
matchAllQuery()
Creates a
Query to get all documents. |
<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. |
<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.
|
default org.elasticsearch.action.search.SearchResponse |
suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
Class<?> clazz)
Deprecated.
since 4.3 use a
NativeSearchQueryBuilder with
NativeSearchQueryBuilder.withSuggestBuilder(SuggestBuilder), call search(Query, Class)
and get the suggest from SearchHits.getSuggest() |
default org.elasticsearch.action.search.SearchResponse |
suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
IndexCoordinates index)
Deprecated.
since 4.3 use a
NativeSearchQueryBuilder with
NativeSearchQueryBuilder.withSuggestBuilder(SuggestBuilder), call search(Query, Class)
and get the suggest from SearchHits.getSuggest() |
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 org.elasticsearch.action.search.SearchResponse suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, Class<?> clazz)
NativeSearchQueryBuilder with
NativeSearchQueryBuilder.withSuggestBuilder(SuggestBuilder), call search(Query, Class)
and get the suggest from SearchHits.getSuggest()suggestion - the queryclazz - the entity class@Deprecated default org.elasticsearch.action.search.SearchResponse suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, IndexCoordinates index)
NativeSearchQueryBuilder with
NativeSearchQueryBuilder.withSuggestBuilder(SuggestBuilder), call search(Query, Class)
and get the suggest from SearchHits.getSuggest()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)
SearchHitsT - 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)
SearchHitsT - 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.Query matchAllQuery()
Query to get all documents. Must be implemented by the concrete implementations to provide an
appropriate query using the respective client.Query idsQuery(List<String> ids)
Query to find get all documents with given ids. Must be implemented by the concrete
implementations to provide an appropriate query using the respective client.ids - the list of ids must not be nullCopyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.