Re: pg_trgm module: no convertion into Trigrams on one side when comparing

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: pg_trgm module: no convertion into Trigrams on one side when comparing
Дата
Msg-id CA+HiwqFmg3gVsDVzYTDeHHnWd=JLSuqkn5FRb0Q8p4KFqsowmQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pg_trgm module: no convertion into Trigrams on one side when comparing  ("Janek Sendrowski" <janek12@web.de>)
Ответы Re: pg_trgm module: no convertion into Trigrams on one side when comparing  ("Janek Sendrowski" <janek12@web.de>)
Список pgsql-general
On Thu, Nov 14, 2013 at 9:05 PM, Janek Sendrowski <janek12@web.de> wrote:
> Hi Amit,
>
> Thanks for your answer.
>
> My issue is that I still need a ranking like the similarity when comparing trigrams.
> I'm working on a similarity search, which determindes similiar sentences from my table.
>
> The usual similarity search with Trigrams and a gist bzw. gin index is to slow with my set of rows.
>
> So I've built an Fixed Query Array. I took some sentences as pivots and calculated the distance between them and all
mysentences. 
> Now I can search for similiar sentences by calculating their distance to my pivots and comparing them with the
distancesI already got. 
> I noticed that it's a good way to use trigrams as metric distance function.
>
> So the issue is that I have to take certain trigrams as pivots and of cource I need to store an exact ranking when
comparing.
> Your method detect the rows which includes all of the trigrams you are searching for, but I still need a ranking...
>
> something like SELECT similarity('How are your', "{" ho","how","are","re "," hi","wha","hat","at ","  a"}"::trgm);
>
> I hope you have an idea

If I understand you correctly, you want to find a similarity value
based NOT on set of tri-grams internally produced by pg_trgm but a
custom set of tri-grams you have chosen. So, you are looking for a way
to provide pg_trgm a custom set of tri-grams to be used for similarity
calculation.

If that is the case, I am not sure if there is any way/interface
currently to do that.

--
Amit


В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Tuning 9.3 for 32 GB RAM
Следующее
От: Philippe Girolami
Дата:
Сообщение: Re: Push predicate down in view containing window function