Re: Fwd: [BUGS] pg_trgm word_similarity inconsistencies or bug
Alexander Korotkov <a.korotkov@postgrespro.ru>
From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Jan Przemysław Wójcik <jan.przemyslaw.wojcik@gmail.com>, Postgres-Bugs <pgsql-bugs@postgresql.org>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2017-12-08T11:50:20Z
Lists: pgsql-bugs, pgsql-hackers
On Thu, Dec 7, 2017 at 8:59 PM, Robert Haas <robertmhaas@gmail.com> wrote: > On Tue, Nov 7, 2017 at 7:51 AM, Jan Przemysław Wójcik > <jan.przemyslaw.wojcik@gmail.com> wrote: > > I'm afraid that creating a function that implements quite different > > algorithms depending on a global parameter seems very hacky and would > lead > > to misunderstandings. I do understand the need of backward compatibility, > > but I'd opt for the lesser evil. Perhaps a good idea would be to change > the > > name to 'substring_similarity()' and introduce the new function > > 'word_similarity()' later, for example in the next major version release. > > That breaks things for everybody using word_similarity() currently. > If the previous discussion of this topic concluded that > word_similarity() was an OK name despite being a slight misnomer, I > don't think we should change our mind now. Instead the new function > can be called something which makes the difference clear, e.g. > strict_word_similarity(), and the old function can remain as it is. +1 Thank you for pointing this. Yes, it would be better not to change existing names and behavior, but adjust documentation and add alternative behavior with another name. Therefore, I'm going to provide patchset of two patches: 1) Improve word_similarity() documentation. 2) Add new function strict_word_similarity() (or whatever better name we invent). ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Commits
-
Update trigram example in docs to correct state
- 9975c128a1d1 11.0 cited
-
Add strict_word_similarity to pg_trgm module
- be8a7a686627 11.0 landed
-
Rework word_similarity documentation, make it close to actual algorithm.
- aea7c17e86e9 11.0 cited