Re: Prefix search, word completion, full text search

Поиск
Список
Период
Сортировка
От Oleg Bartunov
Тема Re: Prefix search, word completion, full text search
Дата
Msg-id Pine.LNX.4.64.0712292345340.13244@sn.sai.msu.ru
обсуждение исходный текст
Ответ на Prefix search, word completion, full text search  (Vincent Bernat <bernat@luffy.cx>)
Ответы Re: Prefix search, word completion, full text search  (Vincent Bernat <bernat@luffy.cx>)
Список pgsql-general
On Sat, 29 Dec 2007, Vincent Bernat wrote:

> Hi !
>
> I am  playing with the new full  text search in PostgreSQL  8.3. I would
> like to search for prefixes to  allow to complete words. For example, if
> I have  the lexemes 'foo', 'foobar' and  'bar', I would like  to get all
> the words whose prefix is 'foo', i.e 'foo' and 'foobar'.
>
> GIST or  GIN (I don't remember)  should allow to search  for prefix. How
> can I query them?

there is no built-in. For your purpose I'd create separate table with
words you want to be completed (anywa, you dont complete garbage words)
and write simple dictionary which generates all prefixes beginning from
minlen (about 3) for input word and use it to create GIN index.
Should works. IIRC, someone already asked about such dictionary and even
posted such dictionary.

>
> Thanks.
>

     Regards,
         Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

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

Предыдущее
От: "Anthony B. Colson"
Дата:
Сообщение: Re: Red Hat 9
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: functional dependency tool