-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
type: enhancementA general enhancementA general enhancement
Milestone
Description
It would be nice if org.springframework.data.elasticsearch.core.SearchOperations#multiSearch(java.util.List<? extends org.springframework.data.elasticsearch.core.query.Query>, java.lang.Class<T>)
supports Multi Search Templates.
At the moment It is possible to use org.springframework.data.elasticsearch.core.query.SearchTemplateQuery
like this:
private final ElasticsearchOperations elasticsearchOperations;
[...]
SearchTemplateQuery searchQueryA = SearchTemplateQuery.builder()
.withId("search_query_template_id")
.withParams(
Map.of(
"param_a", "value")))
.build();
elasticsearchOperations.search(searchQueryA, CustomDoc.class);
But it would be nice to also be able to run Multi Search Templates like this:
private final ElasticsearchOperations elasticsearchOperations;
[...]
SearchTemplateQuery searchQueryA = SearchTemplateQuery.builder()
.withId("search_query_template_id_a")
.withParams(
Map.of(
"param_a", "value")))
.build();
SearchTemplateQuery searchQueryB = SearchTemplateQuery.builder()
.withId("search_query_template_id_b")
.withParams(
Map.of(
"param_a", "value")))
.build();
elasticsearchOperations.multiSearch(List.of(searchQueryA, searchQueryB), CustomDoc.class);
More info: https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-search-template.html
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement