Re: two questions about fulltext searchign / tsvector indexes

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: two questions about fulltext searchign / tsvector indexes
Дата
Msg-id 1402406586.76014.YahooMailNeo@web122301.mail.ne1.yahoo.com
обсуждение исходный текст
Ответ на Re: two questions about fulltext searchign / tsvector indexes  (Vick Khera <vivek@khera.org>)
Список pgsql-general
Vick Khera <vivek@khera.org> wrote:

> Jonathan Vanasco <postgres@2xlp.com> wrote:

> Personally in these days of cheap disks I'd go with the dedicated
> column. Given that, you want to just have a GIN index on that one
> column, and the query you want, given some plain text string like
> "fluffy dog" is this:
>
> select plainto_tsquery('fluffy dog') @@ my_tsv_column;
>
> I always use a trigger on insert and update to maintain the ts_vector
> column, so there is no doubt of how it was computed by various
> programs.

I was going to make a similar recommendation, but Vick beat me to
it.  The only thing I would add, is that you might want to consider
whether a match in one column should carry more weight than a match
in the other column.  If so, you should convert each to a tsvector
separately, and give each one a different weight before
concatenating the tsvector objects and storing the result.

http://www.postgresql.org/docs/current/interactive/textsearch-features.html#TEXTSEARCH-MANIPULATE-TSVECTOR

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


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

Предыдущее
От: Vick Khera
Дата:
Сообщение: Re: two questions about fulltext searchign / tsvector indexes
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: pg_standby replication problem