crude id and phone protection
gitea/wcs/pipeline/head There was a failure building this commit Details

This commit is contained in:
Pierre Ducroquet 2024-02-28 17:13:13 +01:00
parent 11f0998225
commit 8bf2e33553
1 changed files with 6 additions and 1 deletions

View File

@ -1716,7 +1716,12 @@ def init_search_tokens(conn=None, cur=None):
AS $function$
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 from tokenized left join wcs_search_tokens on token % w group by w)
super_tokenized as (
select w,
coalesce(tsquery_agg_or(plainto_tsquery(token) order by token <-> w desc), plainto_tsquery(w)) tokens
from tokenized
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;
$function$;""")