Skip to content

Commit

Permalink
Fix incorrect tsvector conversion to casting.
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 28, 2021
1 parent 01423a7 commit dec4642
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 @@ -3,7 +3,7 @@ WITH q AS (
-- Prepare TS_QUERY tokens for querying with either:
-- a) built in Postgres dictionary/tokenizer ($1=query, $2=Postgres dictionary name)
-- b) externally computed and supplied tokens ($3)
SELECT (CASE WHEN $2 != '' THEN PLAINTO_TSQUERY($2::regconfig, $1::TEXT) ELSE TO_TSQUERY($3) END) AS query
SELECT (CASE WHEN $2 != '' THEN PLAINTO_TSQUERY($2::regconfig, $1::TEXT) ELSE $3::TSQUERY END) AS query
),
directMatch AS (
-- Do a direct string match (first 50 chars) of the query or see if there are matches for
Expand Down

0 comments on commit dec4642

Please sign in to comment.