setweight is not working for me. Need some advice

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)postgresql(dot)org
Cc: veera(dot)sareddy(at)gmail(dot)com
Subject: setweight is not working for me. Need some advice
Date: 2017-12-24 01:01:23
Message-ID: 20171224010123.826.74478@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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 &amp; 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 &amp; 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=&#39;Y&#39;
AND setweight(to_tsvector(&#39;public.english_nostop&#39;,refpsc.psc_code), &#39;A&#39;)
|| &#39;
&#39; || setweight(to_tsvector(&#39;public.english_nostop&#39;,refpsc.psc_name), &#39;B&#39;)
@@ to_tsquery(&#39;public.english_nostop&#39;,&#39;AA17:*&#39;) LIMIT 100

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2017-12-26 12:10:54 Rolycore
Previous Message Alvaro Herrera 2017-12-22 14:53:22 Re: remove endterms and title ids