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)

asked May 6, 2016 at 12:53

1 Answer 1

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

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.