~sircmpwn/godocs.io

gddo: internal/database: Fix searches with multiple words v1 APPLIED

Adnan Maolood: 1
 internal/database: Fix searches with multiple words

 1 files changed, 1 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/godocs.io/patches/22610/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gddo] internal/database: Fix searches with multiple words Export this patch

---
 internal/database/database.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/internal/database/database.go b/internal/database/database.go
index 3f7071a..4eac497 100644
--- a/internal/database/database.go
+++ b/internal/database/database.go
@@ -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)
-- 
2.31.1
Thanks!

To git@git.sr.ht:~sircmpwn/gddo
   d1df353..6b2523d  master -> master