elasticsearch-net
elasticsearch-net copied to clipboard
Make it possible to do a MultiSearch with different types
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.