Such algorithm finds closest pair of (Lpos, Rpos) but satisfying pair could be not closest, example: to_tsvector('simple', '1 2 1 2') @@ '1 <3> 2';Oh ... the indexes in the lists don't have much to do with the distances, do they. OK, maybe it's not quite as easy as I was thinking. I'm okay with the patch as presented.
Huh, I found that my isn't correct for example which I show :(. Reworked patch is in attach.
-- Teodor Sigaev E-mail: teo...@sigaev.ru WWW: http://www.sigaev.ru/
phrase_exact_distance-2.patch
Description: binary/octet-stream
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers