feat: wire chat search box to full-text search (#27973)

This commit is contained in:
Danielle Maywood
2026-08-12 15:04:01 +01:00
committed by GitHub
parent 6765731ea9
commit c424a76a12
21 changed files with 1006 additions and 423 deletions
-13
View File
@@ -6993,19 +6993,6 @@ func (q *sqlQuerier) BatchUpsertChatHeartbeats(ctx context.Context, arg BatchUps
return err
}
const chatSearchQueryIsEmpty = `-- name: ChatSearchQueryIsEmpty :one
SELECT numnode(websearch_to_tsquery('simple', $1::text)) = 0 AS is_empty
`
// Reports whether search text tokenizes to an empty tsquery (e.g. '!!!').
// Used to reject input that would silently match nothing.
func (q *sqlQuerier) ChatSearchQueryIsEmpty(ctx context.Context, search string) (bool, error) {
row := q.db.QueryRowContext(ctx, chatSearchQueryIsEmpty, search)
var is_empty bool
err := row.Scan(&is_empty)
return is_empty, err
}
const countChatQueuedMessages = `-- name: CountChatQueuedMessages :one
SELECT COUNT(*)::bigint AS count
FROM chat_queued_messages