Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no multiSearch method provided by ReactiveElasticsearchOperations in Spring Data Elasticsearch v4 #2491

Open
vishalgoel2 opened this issue Mar 7, 2023 · 4 comments
Labels
type: enhancement A general enhancement

Comments

@vishalgoel2
Copy link

Expected behavior
I expect ReactiveElasticsearchOperations to provide a multiSearch method that can perform a multi-search request using the reactive Elasticsearch client.

Actual behavior
Currently, there is no multiSearch method provided by ReactiveElasticsearchOperations.

Workaround
As a workaround, one can use the StringQuery and create a JSON string that represents a multi-search request. However, this workaround requires manual construction of the multi-search request JSON string, which can be error-prone and cumbersome for complex multi-search requests.

Proposal
I propose to add a multiSearch method to ReactiveElasticsearchOperations that can perform a multi-search request using the reactive Elasticsearch client. This method should simplify the construction of multi-search requests and improve the overall developer experience.

Additional context
Multi-search requests are an important feature of Elasticsearch, and their absence in the reactive Spring Data Elasticsearch v4 library limits the functionality and flexibility of reactive Elasticsearch applications. It is also worth noting that the non-reactive version of Spring Data Elasticsearch already supports multiSearch.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 7, 2023
@sothawo
Copy link
Collaborator

sothawo commented Mar 7, 2023

Note: This would probably need to return a Flux<ReactivSearchHits<T>>.

@sothawo sothawo added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 7, 2023
@sothawo
Copy link
Collaborator

sothawo commented Mar 7, 2023

This won't definitely not be added to version 4, as 5.0 is already released, and new features are not backported to old versions.

@vishalgoel2
Copy link
Author

Would upgrading to Spring Data Elasticsearch 5 require us to adopt Spring Boot 3 and Spring 6? We may not be ready for this upgrade yet and need to evaluate our readiness before making any decisions.
Is there any other workaround available for version 4 of the library, other than manually creating a JSON string? For instance, could we create a list of NativeSearchQuery objects and transform it into a StringQuery object instead?

@sothawo
Copy link
Collaborator

sothawo commented Mar 7, 2023

Would upgrading to Spring Data Elasticsearch 5 require us to adopt Spring Boot 3 and Spring 6?

yes. But this feature would need to be implemented ayway first.

The problem with creating some string query or other work around is, that a multisearch can return different entities for the different queries, that would not be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants