Re: SOLVED: tsearch2 dictionary for statute cites

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: SOLVED: tsearch2 dictionary for statute cites
Дата
Msg-id 49DC84D9.EE98.0025.0@wicourts.gov
обсуждение исходный текст
Ответ на Re: tsearch2 dictionary for statute cites  (Oleg Bartunov <oleg@sai.msu.su>)
Список pgsql-general
Oleg Bartunov <oleg@sai.msu.su> wrote:
>> I probably just need to have that "Aha!" moment, slap my forehead,
and
>> move on; but I'm not quite understanding something.  The answer to
>> this question could be it: Can I use a different set of
dictionaries
>> for creating the tsquery than I did for the tsvector?
>
> Sure ! For example, you want to index all words, so your
dictionaries
> doesn't have stop word lists, but forbid people to search common
words.
> Or, if you want to search 'to be or not to be' you have to use
> dictionaries without stop words.

I found a creative solution which I think meets my needs.  I'm posting
both to help out anyone with similar issues who finds the thread, and
in case someone sees an obvious defect.  By creating one function to
generate the "legal" tsvector (which recognizes statute cites) and
another function to generate the search values, with casts from text
to the ts objects, I can get more targeted results than the parser and
dictionary changes alone could give me.

I'm still working on the dictionaries and the query function, but the
vector function currently looks like the attached.

Thanks to Oleg and Tom for assistance; while neither suggested quite
this solution, their comments moved me along to where I found it.

-Kevin


Вложения

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

Предыдущее
От: Ian Mayo
Дата:
Сообщение: Re: Are there performance advantages in storing bulky field in separate table?
Следующее
От: Jennifer Trey
Дата:
Сообщение: Re: Now I am back, next thing. Final PGS tuning.