-
Notifications
You must be signed in to change notification settings - Fork 802
broken tests for using each_with_hit and search result order #102
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
… not be the natural order. searching for 'code' returns 'Coding' first and 'Test Coding' second from elasticsearch. it compares ids of db records to response result. note: calling to_a within the each_with_hit method changes the _id behavior on the mongoid record. it returned string id originally but after to_a is called, it returns ObjectId instead.
@dwkoogt I've run |
active_record_basic_test.rb is a passing test just to illustrate the problem with mongoid. You need to run mongoid_basic_test.rb |
So the problem is solely with the Mongoid adapter? |
Right, so I can replicate the problem with Mongoid, the fix seems to be in calling Can you please sign the Contributor License Agreement so I can merge your test in? |
@@ -81,6 +81,16 @@ class ::Article < ActiveRecord::Base | |||
end | |||
end | |||
|
|||
should "zip results from records" do |
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.
We should name this better, something like should "preserve the search results order for records" do
Contributor License Agreement has been signed. |
Thanks for the changes!, added the ``to_a` fix and merged in your commits. |
broken tests for using each_with_hit when the returned records should not be the natural order.
this is for issue #99
searching for 'code' returns 'Coding' first and 'Test Coding' second from elasticsearch.
it compares ids of db records to response result.
note: calling to_a within the each_with_hit method changes the _id behavior on the mongoid record. it returned string id originally but after to_a is called, it returns ObjectId instead.