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

Initialize an instance of Search from_hash #22

Open
j-bennet opened this issue Feb 4, 2022 · 0 comments
Open

Initialize an instance of Search from_hash #22

j-bennet opened this issue Feb 4, 2022 · 0 comments

Comments

@j-bennet
Copy link

j-bennet commented Feb 4, 2022

Hi,

I'm trying to figure out how to initialize an instance of Elasticsearch::DSL::Search::Search from a hash, pretty much a complete reverse of to_hash. The idea is to take the json query provided by the user, convert it to hash, instantiate a Search, and enrich it with some additional clauses and options before issuing a request to Elasticsearch. Of course, I could update the user's hash, but being able to use the DSL seems so much nicer and a lot less clunky - if only it worked. It looks like currently this use case is unsupported - the purpose of this library is to go from Ruby DSL to Elasticsearch hashes, not backwards. However, I can't help wondering if perhaps other people ran into the same problem. Can you offer any help / advice?

Thank you.

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

No branches or pull requests

1 participant