-
Notifications
You must be signed in to change notification settings - Fork 746
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
Consistent random sorting #178
Comments
You'll need to modify the query Searchkick generates. query = Product.search "test", execute: false
query.body[:query] = # your code here
products = query.execute |
Thank @ankane. However, I am currently getting stuck in v0.5.3 as I failed to update to v0.6.x due to failure to install a dependency "patron (0.4.18)" in windows machine. I am currently working on that and will keep you updated. Thanks again. |
Yikes, I didn't realize Patron's stance was "Windows users are on your own. Good luck with that." I'm going to remove that dependency on master. |
Hi @ankane, thanks for removing Patron. It works well after updating to v0.6.3 with a sample code below: irb(main):039:0> s = DateTime.now.to_i query = Product.search "*", execute: false irb(main):040:0> query.body[:query] = {function_score:{ random_score: { seed: s } } } product = query.execute Your help is highly appreciated. |
Hi @ankane,
I come up with a requirement of consistent random sorting and found that it is available in elasticsearch with the function_score query. May I know if this can be achieved with searchkick? Thanks.
Ref: http://www.elasticsearch.org/blog/0-90-4-released/
The text was updated successfully, but these errors were encountered: