0

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"
  1. Is it happening because I am using "english" dict while querying with "polish" word?

  2. 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)

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   |
+--------------+
1
  • Perfect, switching to simple dictionary solved the issue. Thanks!
    – user606521
    May 6 '16 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.