tsearch comments

Поиск
Список
Период
Сортировка
От Björn Metzdorf
Тема tsearch comments
Дата
Msg-id 01bf01c2c267$b1643670$0564a8c0@shock
обсуждение исходный текст
Список pgsql-general
Hi,

I was browsing the archives for anything related to tsearch and stumbled
across a post from Christopher Kings-Lynne in Nov 2002. He suggested to have
txt2txtidx as an index function, but he had some problems implementing his
idea.

But his idea works very fine. Just apply the attached patch (against 7.3.1),
install tsearch as normal, and then

CREATE INDEX my_test_idx ON mytable using gist(txt2txtidx(mycolumn));

assuming "mycolumn" is a text-type column.

Then you can search "mycolumn" with

SELECT * FROM mytable WHERE txt2txtidx(mycolumn) ## 'patch&gist';

This method has several advantages:

- you don't have to extend your table with another column
- pg_dump's output won't be bloated
- you don't have to use a special trigger, the index keeps itself up to
date!

Besides, we tested tsearch also with arabian and chinese input, and it works
perfectly with unicode databases as well (although it must be the exact same
phrase, since the builtin stemmer cannot stem chinese :).

Oleg: Can you search your memory why txt2txtidx possibly should not be
marked as "iscachable"?
The rest: Is there perhaps a problem with this approach that I am not aware
of?

Regards,
Bjoern

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re agregates
Следующее
От: Björn Metzdorf
Дата:
Сообщение: Re: tsearch comments