Reputation: 5299
I have a russian dictionary in postgresql 8.4.
I try to use full search but have some troubles.
I dont get any results becouse try to find words by 4-5symbols. For example:
select * from parcels_temp where name_dispatcher @@ to_tsquery('Нику');
Get result: 0 rows.
select * from parcels_temp where name_dispatcher @@ to_tsquery('Никуд');
Get result: 2 rows. its correct.
I try to do search by words not contained in dictionary. What i gonna do in this case? How can i update dictionary in PostgreSQL?
Its must create column to tsvector
or i can use to_tsvector
function i queries? Or its more slowly?
Upvotes: 0
Views: 181
Reputation: 1321
1: By default, postgreSQL only matches the whole word. You can opt in to do a prefix matching:
select * from parcels_temp where name_dispatcher @@ to_tsquery('Нику:*');
See: https://www.postgresql.org/docs/9.5/static/textsearch-controls.html
3: You can create a column and GIN index on it, or you can just create the index without creating a column. I think they are the same in terms of performance. For details, see: https://www.postgresql.org/docs/9.5/static/textsearch-tables.html
Upvotes: 0
Reputation: 41
Postgresql indexer does not process strings shorter than 3 characters. It is done to reduce index size and generation time.
Obviously, you get nothing. There is way to update dictionary, refer to documentation.
Upvotes: 1