Use all text scorers in the final result to increase scoring signal (#26026)
* Uses all text scorers in the final result - instead of just the maximum one - add tests * add prefix scorer test + fix text-score-with * linter fixes * pass in number of results to find * refactor test function * fix linter by removing unused namespace: metabase.util * limit arity of serialize to 3 * make oss-score and ee-score different things - They were defined to be exactly the same, but should be different! - Update some tests that broke when a test function was fixed * remove extra let * move rseq back out of sorted-take * improve test feedback * force weight of text based scorers always weigh 10 * handle 0 score/weights when normalizing scores * add nil check * fix more subtle test differences * more test fiddling - still test that :offset and :limit respect limits * reuse bit->boolean from api collection * clean up some tests - filter -> remove - replace some magic numbers - revert to testing entire maps instead of names of sorted items * add test, docstring, and weight * sort ns requires * responding to most of the review comments * start our zero-score sum check with 0 * do not tokenize / normalize nil raw-search-string * force equality in basic search test * modify test to work in dev and test environments * use display_name in results when appropriate - This was looking for the _first_ column that had a non-zero score, but actually we need to consider all relevant columns. - Uses them to figure out if there is a display name, and if there is, to use it. - Coppied over the logic about showing :context from the prior approach
Showing
- enterprise/backend/test/metabase_enterprise/search/scoring_test.clj 97 additions, 53 deletions.../backend/test/metabase_enterprise/search/scoring_test.clj
- src/metabase/api/collection.clj 1 addition, 8 deletionssrc/metabase/api/collection.clj
- src/metabase/api/common.clj 7 additions, 0 deletionssrc/metabase/api/common.clj
- src/metabase/api/search.clj 23 additions, 27 deletionssrc/metabase/api/search.clj
- src/metabase/search/scoring.clj 131 additions, 88 deletionssrc/metabase/search/scoring.clj
- test/metabase/api/search_test.clj 4 additions, 4 deletionstest/metabase/api/search_test.clj
- test/metabase/search/scoring_test.clj 38 additions, 7 deletionstest/metabase/search/scoring_test.clj
Please register or sign in to comment