Do search on all indexed fields.

This commit is contained in:
Sergio Martínez Portela 2022-10-30 23:44:31 +01:00
parent 7d20941765
commit b676e2f949

View File

@ -64,7 +64,7 @@ func main() {
query := c.Query("q") 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 { if err != nil {
log.Fatal(err) log.Fatal(err)
@ -77,7 +77,7 @@ func main() {
results := make([]map[string]string, 0) results := make([]map[string]string, 0)
rows, err := stm.Query(fmt.Sprintf("%%%v%%", query)) rows, err := stm.Query(query)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
c.JSON(500, gin.H{ c.JSON(500, gin.H{