-
Notifications
You must be signed in to change notification settings - Fork 810
Make sure search request options are passed through. #3
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
Conversation
Definitely!, this looks more lie a typo.
Just a little caveat, will all the changed logic about how the library fetches records from the database, it's no longer possible to do all the tricks for multi-model searches as we did in Tire. On the other hand, that's a can of worms best left on a shelf.
Oh right, perhaps that isn't going to work too well anyway.
So is the recommended approach for searching multiple indices to use Elasticsearch::Model.client and just handle the response hash from yourself?
The MyModel.search().response.results will happily give you "hits" wrapped in Hashie::Mash, so it might be enough to use just that.
In case you want real records, I think you have to map and gather the [klass, ID] pairs, and query the database on your own.
I didn't gave "multi model searches" too much thought, at the current stage of the project, though, so it's possible there might be something to provide on the library level down the road...
Thanks!, Jari, merged & pushed. If you bump into issues when migrating from Tire, ping me here or on IRC.
I think these options are meant to be passed on, not silently ignored.
I discovered this while trying to perform a multi-index search while retaining the niceities of the Response/Results/Result wrapping by doing something like this:
(more or less what I used
Tire.searchfor before)However since the options are not being passed on I'm unable to update the
indexfield.