-
- Downloads
Don't compute only on non-zero scores (#16598)
* Don't compute only on non-zero scores I was removing a helper function when refactoring the scoring. That had a filter on :score?. I'm not sure why i translated this to only interpret the denominator of scoring to only include scores that were positive. This is obviously wrong. Also, previously, all databases would be returned in the archived query which seems obviously wrong. Databases cannot be archived and so should never appear when searching for archived items. * Add some tests - had been asserting that ee-score = os-score if not in an official collection. This is actually hard to do under the current scheme, and actually not important. The important bit is that the relative ordering is the same. It had been adding 0 score 2 weight previously, and removing all scores with a score of 0. This created a bad way to score, as something with 1/2, 0/3, 0/4, 0/10 (net score 1/2=0.5) would appear higher than something with 1/2, 1/3, 1/4, 3/10 (net score 6/19=0.315) and it really shouldn't. The former really should be (1/19=0.05). And since we are adding in a denominator of 2 (official collection weight) all of the scores are actually smaller, but that's ok, as they are all proportionately smaller.
Showing
- enterprise/backend/test/metabase_enterprise/search/scoring_test.clj 30 additions, 14 deletions.../backend/test/metabase_enterprise/search/scoring_test.clj
- src/metabase/api/search.clj 1 addition, 1 deletionsrc/metabase/api/search.clj
- src/metabase/search/scoring.clj 1 addition, 1 deletionsrc/metabase/search/scoring.clj
- test/metabase/search/scoring_test.clj 8 additions, 0 deletionstest/metabase/search/scoring_test.clj
Please register or sign in to comment