Re: SOLVED: tsearch2 dictionary for statute cites - Mailing list pgsql-general

From Kevin Grittner
Subject Re: SOLVED: tsearch2 dictionary for statute cites
Date
Msg-id 49DC84D9.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Re: tsearch2 dictionary for statute cites  (Oleg Bartunov <oleg@sai.msu.su>)
List 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


Attachment

pgsql-general by date:

Previous
From: Ian Mayo
Date:
Subject: Re: Are there performance advantages in storing bulky field in separate table?
Next
From: Jennifer Trey
Date:
Subject: Re: Now I am back, next thing. Final PGS tuning.