Re: [GENERAL] Full text search with plain input

From: Havasvölgyi Ottó <havasvolgyi(dot)otto(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Pg - General <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] Full text search with plain input
Date: 2018-05-05 00:46:28
Message-ID: CAOryeA03o4o24WKeA0G654y-WjtYzqUQx0JKYM16hXoO2iicRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Based on the docs, plainto_tsquery() creates tsquery with the & operator (
https://www.postgresql.org/docs/10/static/functions-textsearch.html), so
the @@ operator will not find partial matches. And this way I cannot
calculate ts_rank for those partial matches.
Now I am thinking about splitting the input text myself to terms, then
searching and ranking the documents for each term. Finally summing the
scores by document. This way the documents with more matching terms would
get greater score.
Please anybody let me know if there is some better/easier solution for this.

Thanks,
Otto

2018-05-05 2:06 GMT+02:00 David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>:

> On Friday, May 4, 2018, Havasvölgyi Ottó <havasvolgyi(dot)otto(at)gmail(dot)com>
> wrote:
>
>> so that it matches (with less rank) even if one of its words match ?
>>
>
> That seems to be what "ts_rank" provides.
>
> David J.
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-05-05 01:12:46 Re: [GENERAL] Full text search with plain input
Previous Message David G. Johnston 2018-05-05 00:06:35 Re: [GENERAL] Full text search with plain input