I have following query:
select
vec.vec,
vec @@ to_tsquery($$'fabr':*A$$), -- true
to_tsquery($$'fabr':*A$$), -- fabr
vec @@ to_tsquery($$'fabry':*A$$), -- false
to_tsquery($$'fabry':*A$$), -- fabri <-- "i" instead of "y"
vec @@ to_tsquery($$'fabryc':*A$$), -- true
to_tsquery($$'fabryc':*A$$) -- fabryc
from (
select setweight(to_tsvector('english', coalesce('fabryczna')), 'A') as vec
) vec
It more details this query converts "fabry" to "fabri":
select to_tsquery($$'fabry':*A$$) -- will return "fabri" instead of "fabry"
Is it happening because I am using "english" dict while querying with "polish" word?
Is it possible to avoid this situation without installing polish dict? Is there any option to just force pg to match EXACT characters? (I don't want to use
like/ilike
)
asked May 6, 2016 at 12:53
1 Answer 1
If you don't want the polish library you can use the simple
dictionary which will keep the y
also:
karoly> select to_tsquery('simple', $$'fabry':*A$$);
+--------------+
| to_tsquery |
|--------------|
| 'fabry':*A |
+--------------+
answered May 6, 2016 at 13:47
-
Perfect, switching to simple dictionary solved the issue. Thanks!user606521– user6065212016年05月06日 15:20:53 +00:00Commented May 6, 2016 at 15:20
lang-sql