Re: Fastest Index/Algorithm to find similar sentences - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: Fastest Index/Algorithm to find similar sentences
Date
Msg-id CAL_0b1stpg-iB28=m2hZM=h1JR9Ji8=-UdVE_NGFEj9RMC=VXQ@mail.gmail.com
Whole thread Raw
In response to Index for Levenshtein distance  ("Janek Sendrowski" <janek12@web.de>)
Responses Re: Fastest Index/Algorithm to find similar sentences  ("andres.pascal" <andrespascal22@gmail.com>)
List pgsql-general
On Sun, Aug 11, 2013 at 6:20 AM, Janek Sendrowski <janek12@web.de> wrote:
> the ranking functions are nice, but if I search for one more word, which is not included in the sentence I'm
searchingfor, It doesn't find the sentence. 

I have already wrote you earlier about it. You can solve the problem
by using & (AND), | (OR), and ! (NOT) operators in tsquery.

select to_tsquery('tiger | largest | cat | species') @@
to_tsvector('The tiger is the largest cat');
 ?column?
----------
 t

The query contains one word more than the sentence (the word is
"species"), and it successfully finds it.

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray.ru@gmail.com


pgsql-general by date:

Previous
From: "ascot.moss@gmail.com"
Date:
Subject: Re: replication server: LOG: invalid magic number 0000 in log file 169, segment 77, offset 4325376
Next
From: Bruno Wolff III
Date:
Subject: Re: earthdistance