Order by best match when searching
The search option is really great, however would be nice to have a option to filter by best match.
One option would offer the possibility to enable this feature like :
class Constants:
# ....
enable_search_weight: bool = False
In this case, when searching, it will apply an order on the weight of the search: one example for the weight is to sort by the length of the field(s) searched : https://stackoverflow.com/questions/15471718/how-to-sort-results-by-string-length-on-mongodb
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.
It is easy to override the Filter.sort method and apply your custom sorting. I'm not familiar with mongodb but this looks promising: https://www.mongodb.com/docs/manual/core/indexes/index-types/index-text/control-text-search-results/
Don't forget to provide a PR when your implementation is ready!
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days.