Skip to content

Commit

Permalink
Eliminate numbers and spaces in direct word match query.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Dec 5, 2023
1 parent b63a452 commit 9607367
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 @@ -27,7 +27,7 @@ directMatch AS (
AND (COALESCE(CARDINALITY($5::TEXT[]), 0) = 0 OR entries.tags && $5)
AND (
CASE WHEN $1 = '' THEN TRUE ELSE
LOWER(SUBSTRING(content, 0, 50))=LOWER(SUBSTRING($1, 0, 50))
REGEXP_REPLACE(LOWER(SUBSTRING(content, 0, 50)), '[0-9\s]+', '', 'g') = REGEXP_REPLACE(LOWER(SUBSTRING($1, 0, 50)), '[0-9\s]+', '', 'g')
OR tokens @@ PLAINTO_TSQUERY('simple', $1)
END
)
Expand Down

0 comments on commit 9607367

Please sign in to comment.