You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
Let say i have two records and I'm running a query such that the order of the resulting records are reversed. I'm running a simple function score query and I can see that record #2 has higher score than record #1 (in response.response). But when I get the records, the result order is back to natural order. I tried to show the records' scores with each_with_hit function and saw that the scores are switched. I looked into the code and saw two problems. In the adapter code, it's using $in query for array of ids. I believe mongo returns results in natural order unless sort is defined. It will not return the results with the ids' array order. Then in the records class, this db result ( #1, #2) is zipped with elasticsearch result (#2, #1). Hence the scores get switched.