elasticsearch-net icon indicating copy to clipboard operation
elasticsearch-net copied to clipboard

Make it possible to do a MultiSearch with different types

Open erik-kallen opened this issue 5 months ago • 2 comments

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.

erik-kallen avatar Sep 20 '24 08:09 erik-kallen