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

MultiSearch with multiple document types #8079

Open
schoder-moreno opened this issue Apr 4, 2024 · 1 comment
Open

MultiSearch with multiple document types #8079

schoder-moreno opened this issue Apr 4, 2024 · 1 comment
Labels

Comments

@schoder-moreno
Copy link

I have a usecase where I want to use the multisearch API to search two separate indices, with differing document types. Looks like this was quite straightforward using NEST, but I can't find an easy way using Elastic.Clients.Elasticsearch 8.12.0. The type argument that is present on all the MultiSearch methods implies that returning different document types for each search is not supported. Is that correct?

I suppose I could specify TDocument as object or string and do my own serialization, but would much prefer out-of-the-box support for this. Is that something you plan to provide in the future?

@flobernd flobernd added 8.x Relates to 8.x client version Area: Helpers Category: Enhancement labels Apr 4, 2024
@flobernd
Copy link
Member

flobernd commented Apr 4, 2024

Hi @schoder-moreno,

this is currently not on my roadmap, but sounds like a useful feature. I have to check how this was implemented in NEST and how much effort it would be to port it over. Feel free to create a PR as well!

Deserializing to object or RawJsonString followed by custom deserialization call should work for now.

An alternative would be to use polymorphism with System.Text.Json. This option however, would probably require you to add a new property to your already ingested data.

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

No branches or pull requests

2 participants