Work around imprecisions in ES result ordering#1776
Work around imprecisions in ES result ordering#1776pcapriotti wants to merge 3 commits intodevelopfrom
Conversation
This sorts the result list after the fact by putting exact handle and name searches at the beginning, so we don't have to rely on ES being precise with the ordering of exact matches. Hopefully this fixes the flakyness of the `order-name` integration test, and makes #1774 unnecessary.
|
Multiple search tests, both local and for federation fail. So this change seems to break things. CI has detailed logs. |
| let maxResults = maybe 15 (fromIntegral . fromRange) maybeMaxResults | ||
| teamSearchInfo <- mkTeamSearchInfo | ||
|
|
||
| maybeExactHandleMatch <- exactHandleSearch teamSearchInfo |
There was a problem hiding this comment.
There is a problem here: whether or not results are returned for users depends on the searchable flag (team users are by default not searchable by prefix search, but only by exact-handle-in-cassandra-search). The changeset here by no longer doing a request to cassandra omits those results entirely. That might at least partially explain the test failures.
The logic is a bit weird and grew as more requirements were tacked on to the product.
|
On second thought, this approach is completely flawed, because sorting of results has to happen before the limit is applied. This should either be fixed at the Lucene level, or ignored. Closing this. |
|
ah, just saw that you didn't merge this. good, as it explains that it just happened again here: |
|
That's right. I've now submitted #1798 to just remove this flaky test. However, as soon as I've done that, another integration test run failed because of some other flaky search order test: Looks like the way we have set things up with search, the order of ES results is just not reliable. Either we play around with boosts, or we make these tests deterministic and with reasonable inputs, so that they stop flaking so much. |
This sorts the result list after the fact by putting exact handle and name searches at the beginning, so we don't have to rely on ES being precise with the ordering of exact matches.
Hopefully this fixes the flakyness of the
order-nameintegration test, and makes #1774 unnecessary.Checklist
changelog.d.