nycmeshnet / meshdb

A convenient, stable, and sane database for tracking Members and Nodes for use with robots and humans
https://db.mesh.nycmesh.net
MIT License
8 stars 13 forks source link

Dramatically improve search relevancy using Postgres' search ranking features #497

Closed Andrew-Dickinson closed 1 week ago

Andrew-Dickinson commented 2 weeks ago

Use the SearchRanking class to rank search result relevancy in the admin UI. This makes an incredible difference. See examples in thread below

Also made some small tweaks to the fields included in the search, to remove things that were harming relevancy without adding much value

Pro tip: this PR also includes a refactor, so the diff is a bit messy. Step through commit-by-commit and it will make more sense

Closes #477 Closes #470

Andrew-Dickinson commented 2 weeks ago
Before After
Screenshot 2024-08-29 at 22 28 36 Screenshot 2024-08-30 at 01 12 18
Screenshot 2024-08-29 at 22 28 49 Screenshot 2024-08-30 at 01 12 02
Screenshot 2024-08-29 at 22 29 00 Screenshot 2024-08-30 at 01 12 27
Screenshot 2024-08-30 at 01 23 02 Screenshot 2024-08-30 at 01 22 09
Screenshot 2024-08-30 at 01 27 29 Screenshot 2024-08-30 at 01 27 51
codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 97.61905% with 2 lines in your changes missing coverage. Please review.

Project coverage is 93.14%. Comparing base (a8c0dff) to head (202ee47). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/meshapi/admin/ranked_search.py 92.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #497 +/- ## ========================================== + Coverage 93.01% 93.14% +0.12% ========================================== Files 69 71 +2 Lines 2692 2741 +49 ========================================== + Hits 2504 2553 +49 Misses 188 188 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.