Re: Term positions in GIN fulltext index

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Term positions in GIN fulltext index
Дата
Msg-id 4EB289320200002500042992@gw.wicourts.gov
обсуждение исходный текст
Ответ на Term positions in GIN fulltext index  (Yoann Moreau <yoann.moreau@univ-avignon.fr>)
Список pgsql-hackers
Yoann Moreau <yoann.moreau@univ-avignon.fr> wrote:
> I'd need a function like this :
> select term_positions(text, 'get') from docs;
>   id_doc | positions
> --------+-----------
>        1 |     {2,6}
>        2 |       {3}
> 
> I'd like to add this function in my database, for experimental
> purpose. I got a look at the source code but didn't find some code
> example using the GIN index ;
> I can not figure out where the GIN index is read as a tsvector
> or where the '@@' operator gets the matching tsvectors for the
> terms of the tsquery.
> 
> Any help about where to start reading would be very welcome :)
I'm not really clear on what you want to read about.  Do you need
help creating your own function on the fly, or with how to access
the information to write the function?
If the former, these links might help:
http://www.postgresql.org/docs/9.1/interactive/extend.html
http://www.postgresql.org/docs/9.1/interactive/sql-createfunction.html
If the latter, have you looked at this file?:
src/backend/utils/adt/tsrank.c
Or was it something else that I'm missing?
-Kevin


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: heap vacuum & cleanup locks
Следующее
От: Simon Riggs
Дата:
Сообщение: Refactor xlog.c #2 - xlog functions