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
{{ message }}
Repository navigation
Local mode: recommend/discovery/context/feedback queries mis-order and mis-threshold on Euclid/Manhattan #1378
Recommend / discovery / context / relevance-feedback queries score points from the internal core distance, which is oriented so a higher score is always better regardless of the collection metric. On Euclid/Manhattan collections in local mode, two paths in LocalCollection.search treat those scores using the raw distance order instead, producing wrong results.
1. Relevance-feedback returns the farthest points first (reversed order).
Feedback results ordered nearest-first ([1, 5, 9]), and score_threshold keeps the points scoring at/above the threshold for the recommend/discovery/context/feedback family.
Root cause
Both the result ordering and the score_threshold check derive their direction from distance_to_order(distance) (the raw distance order). For the recommend/discovery/context/feedback family the scores are higher-is-better on every metric, so on Euclid/Manhattan the ordering special-case must apply (it omitted NaiveFeedbackQuery) and the threshold direction must match — instead the threshold followed the raw order and inverted.
I have a fix that derives a single higher-is-better flag from the query type and uses it for both the ordering and the threshold, plus regression tests over both metrics.
changed the title [-]Local mode: relevance-feedback query returns farthest points first on Euclid/Manhattan (reversed order)[/-][+]Local mode: recommend/discovery/context/feedback queries mis-order and mis-threshold on Euclid/Manhattan[/+]on Aug 25, 2026
Activity
[-]Local mode: relevance-feedback query returns farthest points first on Euclid/Manhattan (reversed order)[/-][+]Local mode: recommend/discovery/context/feedback queries mis-order and mis-threshold on Euclid/Manhattan[/+]