favor a perfect match
gitea/wcs/pipeline/head There was a failure building this commit
Details
gitea/wcs/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
311a3b403e
commit
0807aaa1ca
|
@ -1718,8 +1718,9 @@ with
|
|||
tokenized as (select unnest(regexp_split_to_array($1, '\s+')) w),
|
||||
super_tokenized as (
|
||||
select w,
|
||||
coalesce(tsquery_agg_or(plainto_tsquery(token) order by token <-> w desc), plainto_tsquery(w)) tokens
|
||||
coalesce(perfect.token, tsquery_agg_or(plainto_tsquery(token) order by token <-> w desc), plainto_tsquery(w)) tokens
|
||||
from tokenized
|
||||
left join wcs_search_tokens perfect on token = plainto_tsquery(w)::text
|
||||
left join wcs_search_tokens on token % w and w not similar to '%[0-9]{2,}%'
|
||||
group by w)
|
||||
select tsquery_agg_and(tokens) from super_tokenized;
|
||||
|
|
Loading…
Reference in New Issue