Re: Fuzzy substring searching with the pg_trgm extension

From: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fuzzy substring searching with the pg_trgm extension
Date: 2016-03-22 13:19:39
Message-ID: 56F1466B.7070302@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

I attached the patch, which fixes the pg_trgm documentation.

On 19.03.2016 01:18, Artur Zakirov wrote:
>
>
> 2016-03-18 23:46 GMT+03:00 Jeff Janes <jeff(dot)janes(at)gmail(dot)com
> <mailto:jeff(dot)janes(at)gmail(dot)com>>:
>
>
> <% and <<-> are not documented at all. Is that a deliberate choice?
> Since they were added as convenience functions for the user, I think
> they really need to be in the user documentation.
>
>
> I can send a patch a little bit later. I documented %>
> and <->> because examples of other operators have the following order:
>
> SELECT t, t <-> 'word' AS dist
> FROM test_trgm
> ORDER BY dist LIMIT 10;
>
> and
>
> SELECT * FROM test_trgm WHERE t LIKE '%foo%bar';
>
> I did not include <% and <<-> because I did not know how to document
> commutators. But I can fix it.
>
> And honestly the following order:
>
> SELECT 'word' <% t FROM test_trgm;
>
> is more convenient to me too.
>
> Do you know how do not break the line in the operators table in the
> first column? Now I see:
>
> Operator| Returns
> ----------------|------------------
> text % | boolean
> text |
>
> But the following is better:
>
> Operator| Returns
> ----------------|------------------
> text % text | boolean
>
>
> Also, the documentation should probably include <% and <<-> as the
> "parent" operators and use them in the examples, and only mention %>
> and <->> in passing, as the commutators. That is because <% and <<->
> take their arguments in the same order as word_similarity does. It
> would be less confusing if the documentation and the examples didn't
> need to keep changing the argument orders.
>
> Cheers,
>
> Jeff
>
>
>
>
> --
> Artur Zakirov
> Postgres Professional: http://www.postgrespro.com
> Russian Postgres Company

--
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

Attachment Content-Type Size
pg-trgm-word-doc.patch text/x-patch 4.3 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-03-22 13:20:53 Re: Speedup twophase transactions
Previous Message Andres Freund 2016-03-22 13:11:53 Re: Proposal: Generic WAL logical messages