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

Feature request: allow eager loading when searching across multiple models #990

Open
SeanLF opened this issue Apr 9, 2021 · 0 comments · May be fixed by #991
Open

Feature request: allow eager loading when searching across multiple models #990

SeanLF opened this issue Apr 9, 2021 · 0 comments · May be fixed by #991
Labels

Comments

@SeanLF
Copy link

SeanLF commented Apr 9, 2021

When searching on a single model, we can chain methods like includes.
However this fails when searching across multiple models:

search = Elasticsearch::Model.search(query: {}, [ModelA, ModelB])
db_records = search.records.includes(:association)

=> Elasticsearch::Transport::Transport::Errors::BadRequest

It'd be nice to be able to do this without having to monkey patch the library.

@stale stale bot added the stale label Jan 9, 2022
@elastic elastic deleted a comment from stale bot Jan 12, 2022
@stale stale bot removed the stale label Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants