Answer the question
In order to leave comments, you need to log in
Why is GIN index not used in Postgresql with weight setting?
Why with GIN index (with weight setting):
CREATE INDEX search_idx ON price_items USING GIN (setweight(to_tsvector('russian', make_name), 'A'), setweight(to_tsvector('russian', detail_name), 'B'));
SELECT * FROM price_items
WHERE setweight(to_tsvector('russian', make_name), 'A') || setweight(to_tsvector('russian', detail_name), 'B') @@ plainto_tsquery('russian', 'отличное слово')
ORDER BY ts_rank(setweight(to_tsvector('russian', make_name), 'A') || setweight(to_tsvector('russian', detail_name), 'B'), plainto_tsquery('russian', 'отличное слово')) DESC;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question