Re: Fuzzy substring searching with the pg_trgm extension - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Fuzzy substring searching with the pg_trgm extension
Date
Msg-id 20160129153951.GA773484@alvherre.pgsql
Whole thread Raw
In response to Re: Fuzzy substring searching with the pg_trgm extension  (Teodor Sigaev <teodor@sigaev.ru>)
Responses Re: Fuzzy substring searching with the pg_trgm extension  (Artur Zakirov <a.zakirov@postgrespro.ru>)
Re: Fuzzy substring searching with the pg_trgm extension  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
Teodor Sigaev wrote:
> >The behavior of this function is surprising to me.
> >
> >select substring_similarity('dog' ,  'hotdogpound') ;
> >
> >  substring_similarity
> >----------------------
> >                  0.25
> >
> Substring search was desined to search similar word in string:
> contrib_regression=# select substring_similarity('dog' ,  'hot dogpound') ;
>  substring_similarity
> ----------------------
>                  0.75
> 
> contrib_regression=# select substring_similarity('dog' ,  'hot dog pound') ;
>  substring_similarity
> ----------------------
>                     1

Hmm, this behavior looks too much like magic to me.  I mean, a substring
is a substring -- why are we treating the space as a special character
here?

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Sequence Access Method WIP
Next
From: Aleksander Alekseev
Date:
Subject: Re: [WIP] Effective storage of duplicates in B-tree index.