Skip to content

Commit

Permalink
Fix incorrect search tokenization in SQL query
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Mar 26, 2021
1 parent 1c0dba7 commit f8023d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion queries.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ directMatch AS (
($4 = '' OR lang=$4)
AND (COALESCE(CARDINALITY($5::TEXT[]), 0) = 0 OR types && $5)
AND (COALESCE(CARDINALITY($6::TEXT[]), 0) = 0 OR tags && $6)
AND (LOWER(SUBSTRING(content, 0, 50))=LOWER(SUBSTRING($1, 0, 50)) OR tokens @@ TO_TSQUERY('simple', $2))
AND (LOWER(SUBSTRING(content, 0, 50))=LOWER(SUBSTRING($1, 0, 50)) OR tokens @@ TO_TSQUERY($2::regconfig, $1))
ORDER BY rank DESC
OFFSET $7 LIMIT $8
),
Expand Down

0 comments on commit f8023d2

Please sign in to comment.