-
Notifications
You must be signed in to change notification settings - Fork 757
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
add indices_boost option support #283
Conversation
Awesome, thanks @exAspArk! To get this ready for a merge, the readme needs updated and a test case added. You want to give it a shot? |
@ankane done :) Please have a look, I've made some workarounds with aliases while Elasticsearch can not use them for |
@ankane ping :) |
It's a shame this was never accepted. I had to write a custom query to get around it. :/ |
Hey @exAspArk, sorry for letting this stagnate. It looks like there's still an issue with the indices_boost and aliases. I'm not excited about the performance implications of this approach (an additional Elasticsearch call for each index), but seems like the best we can do. We could cache the aliases, but would need to invalidate them after a reindex, which could be hard to detect without additional complexity. I've added a few comments inline. Happy to merge once they are addressed. |
Boost indices when searching across more than one index | ||
|
||
```ruby | ||
indices_boost: { Animal.searchkick_index.name => 1, Product.searchkick_index.name => 200 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also allow indices_boost: {Animal: 1, Product: 200}
? We do this with the index_name
option.
Hey @ankane, thanks for your feedback! I've pushed the changes. Yep, it's sad that we have to make additional requests while the issue is still open elastic/elasticsearch#4756. |
@@ -168,6 +168,12 @@ boost_where: {user_id: {value: 1, factor: 100}} # default factor is 1000 | |||
boost_where: {user_id: [{value: 1, factor: 100}, {value: 2, factor: 200}]} | |||
``` | |||
|
|||
Boost indices when searching across more than one index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this to a section about searching multiple indexes? (maybe right above the reference section)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I can take this one. Thanks @exAspArk!
👍 |
Hi, I'd like to add indices_boost support. For example: