Re: tsearch2 in PostgreSQL 8.3?

Поиск
Список
Период
Сортировка
Искать
От
Trevor Talbot
Тема
Re: tsearch2 in PostgreSQL 8.3?
Дата
Msg-id
90bce5730708181141i3e6b1c75xfb8c3148c014bc29@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Re: tsearch2 in PostgreSQL 8.3? "Luke Lonergan" <LLonergan@greenplum.com>
Re: tsearch2 in PostgreSQL 8.3? Bruce Momjian <bruce@momjian.us>
On 8/18/07, Bruce Momjian  wrote:
> Trevor Talbot wrote:

> > Well, you could create a function that returns a tsvector, but how do
> > you get that to work with queries?  I've been under the impression the
> > expressions need to match (in the normal case, be the same function
> > with the same arguments) in order to use the index.
>
> Yes, so you create a function called complex_ts and create the index:
>
>         CREATE INDEX ii on x USING GIT(complex_ts(col1, col2))
>
> and in your WHERE clause you do:
>
>         WHERE 'a & b' @@ complex_ts(col1, col2)

Oh, duh, of course.  I kept thinking of the index as something
abstract instead of reusing the expression, even when the examples
were right in front of me...


On 8/18/07, Joshua D. Drake  wrote:
> Bruce Momjian wrote:

> >       CREATE INDEX ii on x USING GIT(complex_ts(col1, col2))
>
> GIN?

Freudian slip, that's what he thinks of me :D

В списке pgsql-hackers по дате отправления
От: Joshua D. Drake
Дата:
От: Trevor Talbot
Дата:
Сообщение: Re: text search vs schemas
FAQ