guardian / typerighter

Even if you’re the right typer, couldn’t hurt to use Typerighter!
Apache License 2.0
276 stars 12 forks source link

Add similarity ordering to rule search #467

Closed jonathonherbert closed 6 months ago

jonathonherbert commented 6 months ago

What does this change?

I was searching for a dictionary rule, and realised that Typerighter's rule search is not very good.

Part of the reason is that we use a trigram index for comparing words, but do not order by similarity to the search term. This PR adds that ordering, so the results most similar to the search term are surfaced first.

Before After
Screenshot 2024-04-08 at 09 40 25 Screenshot 2024-04-06 at 15 18 48

How to test

prout-bot commented 6 months ago

Seen on Rule Manager (merged by @jonathonherbert 9 minutes and 34 seconds ago) Please check your changes!

prout-bot commented 6 months ago

Overdue on Checker (merged by @jonathonherbert 15 minutes and 3 seconds ago) What's gone wrong?