Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: search issue sql (#10474)

p0ny6f5c57cf598b
diff --git a/backend/store/issue.go b/backend/store/issue.go
index 3fad91ea5d..bf4e267bcd 100644
--- a/backend/store/issue.go
+++ b/backend/store/issue.go
@@ -428,7 +428,7 @@ func (s *Store) ListIssueV2(ctx context.Context, find *FindIssueMessage) ([]*Iss
}
if v := find.Query; v != nil && *v != "" {
if tsQuery := getTsQuery(*v); tsQuery != "" {
- from += fmt.Sprintf(`, CAST($%d AS tsquery) AS query`, len(args)+1)
+ from += fmt.Sprintf(` LEFT JOIN CAST($%d AS tsquery) AS query ON TRUE`, len(args)+1)
args = append(args, tsQuery)
where = append(where, "issue.ts_vector @@ query")
orderByClause = "ORDER BY ts_rank(issue.ts_vector, query) DESC, issue.id DESC"