From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: Bayer, Samuel <sam@mitre.org>
Cc: Atri Sharma <atri.jiit@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: [EXT] Re: Looking for tips on improving full-text search quality in Postgres
Date: Fri, 04 Mar 2022 11:09:46 -0500
Message-ID: <3886250.1646410186@sss.pgh.pa.us> (raw)
In-Reply-To: <YiI2GWUWvsvOp02z@momjian.us>
References: <7ce98668-3fdb-254a-fa81-f1c4d09e6607@mitre.org>
<23582_1646407541_62222F75_23582_337_5_YiIvdEhT5BecGxPY@momjian.us>
<fffa4832-7ce5-d828-caaf-8fc5578b3029@mitre.org>
<CAOeZVid0ZoaQzJL=-W_+jtWjL4HyezPzGhko_CDY=rYpk024DQ@mail.gmail.com>
<4b5afb83-3e90-17c7-2650-9bd521e958a7@mitre.org>
<YiI2GWUWvsvOp02z@momjian.us>
Bruce Momjian <bruce@momjian.us> writes:
> On Fri, Mar 4, 2022 at 10:41:16AM -0500, Bayer, Samuel wrote:
>> I apologize for not being able to be more specific.
> I know it is hard to quantify. Is it possible that Postgres is treating
> all the terms equally, while Solr is prioritizing terms that are earlier
> in the document?
A few basic questions:
* which ranking function are you using?
* with what options?
* which PG version exactly?
As far as I can see from a quick look at the docs, neither
ts_rank() nor ts_rank_cd() consider "earlier in the document"
to be an interesting consideration. They do have the ability
to prefer terms that have been marked as having a higher weight,
but you'd need to do some setup work to make that useful ---
basically, you'd have to separate out the title or other metadata
and apply setweight() to it while building the tsvectors.
I wouldn't be surprised if Solr has some well-tuned default
heuristics that mean that you don't have to work hard to get
good results from it. The current state of our FTS features
is more like "here's all the parts, but you have to build the
behavior you want".
ISTM that our FTS features have basically been on autopilot
since they went in. I'd sort of hoped that we'd see more
parsers, more ranking functions, etc, over time ... but nothing
like that has happened. I'm not sure if that's just lack of
interest, or if people find the code too difficult to work with.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, bruce@momjian.us, sam@mitre.org, atri.jiit@gmail.com
Subject: Re: [EXT] Re: Looking for tips on improving full-text search quality in Postgres
In-Reply-To: <3886250.1646410186@sss.pgh.pa.us>
References: <7ce98668-3fdb-254a-fa81-f1c4d09e6607@mitre.org> <23582_1646407541_62222F75_23582_337_5_YiIvdEhT5BecGxPY@momjian.us> <fffa4832-7ce5-d828-caaf-8fc5578b3029@mitre.org> <CAOeZVid0ZoaQzJL=-W_+jtWjL4HyezPzGhko_CDY=rYpk024DQ@mail.gmail.com> <4b5afb83-3e90-17c7-2650-9bd521e958a7@mitre.org> <YiI2GWUWvsvOp02z@momjian.us> <3886250.1646410186@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox