~sircmpwn/gddo

d1df353d9772f81b14993671942b58b885d19b1e — Adnan Maolood a month ago 6b2523d master
internal/database: Fix searches with multiple words
1 files changed, 1 insertions(+), 1 deletions(-)

M internal/database/database.go
M internal/database/database.go => internal/database/database.go +1 -1
@@ 132,7 132,7 @@ func (db *Database) Search(ctx context.Context, q string) ([]Package, error) {
			WHERE p.searchtext @@ websearch_to_tsquery('english', $1)
				AND m.module_path = p.module_path AND p.version = m.latest_version
				AND i.import_path = p.import_path
			ORDER BY ts_rank(p.searchtext, to_tsquery('english', $1)) DESC,
			ORDER BY ts_rank(p.searchtext, websearch_to_tsquery('english', $1)) DESC,
				p.score DESC
			LIMIT 20;
			`, q)