From b676e2f94943184ff881c2a93076495d64b431a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Sun, 30 Oct 2022 23:44:31 +0100 Subject: [PATCH] Do search on all indexed fields. --- scripts/search-server/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/search-server/server.go b/scripts/search-server/server.go index 86a7eb0..8914956 100644 --- a/scripts/search-server/server.go +++ b/scripts/search-server/server.go @@ -64,7 +64,7 @@ func main() { query := c.Query("q") - stm, err := db.Prepare("SELECT note_id, title, top_level_title, is_done, is_todo FROM note_search WHERE title LIKE ?") + stm, err := db.Prepare("SELECT note_id, title, top_level_title, is_done, is_todo FROM note_search(?)") if err != nil { log.Fatal(err) @@ -77,7 +77,7 @@ func main() { results := make([]map[string]string, 0) - rows, err := stm.Query(fmt.Sprintf("%%%v%%", query)) + rows, err := stm.Query(query) if err != nil { log.Fatal(err) c.JSON(500, gin.H{