Skip to content

Sort search results by relevance #6404

@Nutomic

Description

@Nutomic

By default search results are sorted using "Top all time", which means that most upvoted items are shown first. So relevant results with less upvotes can actually be buried further down.

There is a Postgres function ts_rank to help with this sorting. However it seems to require an extra tsvector column in the searched data.

References:
https://dev.to/tdournet/how-to-optimise-postgresql-like-and-ilike-queries-494i
https://stackoverflow.com/questions/12933805/best-way-to-use-postgresql-full-text-search-ranking?rq=4

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions