Thread: setweight is not working for me. Need some advice

setweight is not working for me. Need some advice

From
PG Doc comments form
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/8.3/static/textsearch-controls.html
Description:

Its not giving the appropriate results:

I want to search within 2 columns (psc_code & psc_name). I want to retrieve
the psc_code data first and then I should display the psc_name data.

I created new index, function & trigger with setweight.. but no desired
result.

Here is my query :  Am I missig something . ?

SELECT refpsc.* FROM
        iae_reference.ref_product_service_code refpsc
    WHERE  1=1 
    AND refpsc.active_ind='Y' 
    AND  setweight(to_tsvector('public.english_nostop',refpsc.psc_code), 'A')
|| ' 
    ' ||  setweight(to_tsvector('public.english_nostop',refpsc.psc_name), 'B')
 @@ to_tsquery('public.english_nostop','AA17:*')  LIMIT 100