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

Make it possible to do a MultiSearch with different types #8355

Open
Tracked by #8356
erik-kallen opened this issue Sep 20, 2024 · 2 comments
Open
Tracked by #8356

Make it possible to do a MultiSearch with different types #8355

erik-kallen opened this issue Sep 20, 2024 · 2 comments
Labels
8.x Relates to 8.x client version Category: Feature Usability

Comments

@erik-kallen
Copy link

erik-kallen commented Sep 20, 2024

Is your feature request related to a problem? Please describe.
Unless I'm missing something, it appears to not be possible to perform a multisearch/multiget with different types from different indices in the same request

Describe the solution you'd like

Something like

var response = await _client.MultiSearchAsync(req =>
{
    req.AddSearch<FirstType>(q => q.Index("FirstIndex").SomethingElse(...));
    req.AddSearch<SecondType>(q => q.Index("SecondIndex").SomethingElse(...));
});

I guess the response type would have to be MultiSearchResponse<object>.

Describe alternatives you've considered
Currently I do two requests and use Task.WhenAll(), which works but seems like it causes an unnecessary workload for Elastic.

@flobernd flobernd added 8.x Relates to 8.x client version Usability labels Sep 23, 2024
@flobernd
Copy link
Member

This sounds a little bit like the "multi" version of what's described in #7792

@erik-kallen
Copy link
Author

Related, but not quite. In this case I only need the same filter type as output type, but different for each query. Though using different filter and output types for multi as well is a natural improvement that would certainly be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.x Relates to 8.x client version Category: Feature Usability
Projects
None yet
Development

No branches or pull requests

2 participants