Skip to content

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

Open
@erik-kallen

Description

@erik-kallen

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions