Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
jarib wants to merge 1 commit into elastic:master from jarib:fix-search-request-options

Conversation

@jarib
Copy link
Contributor

@jarib jarib commented Jan 25, 2014

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:

Foo.search({query: ...}, index: [Foo.index_name, Bar.index_name].join(','))

(more or less what I used Tire.search for before)

However since the options are not being passed on I'm unable to update the index field.

Copy link
Contributor

karmi commented Jan 26, 2014

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.

Copy link
Contributor Author

jarib commented Jan 26, 2014

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?

Copy link
Contributor

karmi commented Jan 26, 2014

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...

Copy link
Contributor

karmi commented Jan 27, 2014

Thanks!, Jari, merged & pushed. If you bump into issues when migrating from Tire, ping me here or on IRC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /