From: | Oleg Bartunov <oleg(at)sai(dot)msu(dot)su> |
---|---|
To: | darklow <darklow(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: FTS wildcard and custom ispell dictionary problem |
Date: | 2010-08-19 09:43:17 |
Message-ID: | Pine.LNX.4.64.1008191342520.25483@sn.sai.msu.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, 19 Aug 2010, darklow wrote:
> Hello,
>
> I am using PostgreSQL 8.4 full text search in following way:
>
> Custom FTS configuration called "dc2" with these dictionaries in
> following order for asciihword token: latvian_ispell, english_stem,
> russian_stem
>
> Latvian ispell dictionary contains words with different endings but
> same meaning (latvian langiage specifics, plural words, etc)
> The problem starts when using wildcard :* to_tsquery syntax.
>
> For example. If i look for the word "kriev" i am automatically adding
> wildcard using syntax: to_tsquery('dc2', 'kriev:*');
>
> By searching kriev:* FTS founds word "krievs" in latvian_ispell
> dictionary which is totally ok.
>
> SELECT * from ts_debug('dc2', 'kriev:*');
> alias | description | token | dictionaries
> | dictionary | lexemes
> -----------+-----------------+-------+----------------------------------------------------------+----------------+----------
> asciiword | Word, all ASCII | kriev |
> {latvian_ispell,english_stem,russian_stem} | latvian_ispell | {krievs}
> blank | Space symbols | :* | {}
>
> If understand correctly now database uses not kriev:* but krievs:* for
> following queries.
>
> And here is the problem, data contains also word: Krievija, and in
> this case search doesn't find it, because now it looks for Krievs:*
> and not Kriev:* anymore.
>
> Is there any solution anone could suggest to get results by both
> criterias - kriev:* (starting query) and krievs:* (founded in ispell
> dict).
>
> Only idea i had is to somehow combine two tsqueries one -
> to_tsquery('dc2', 'kriev:*') and to_tsquery('english', 'kriev:*'); so
> the search looks for both - kriev:* and krievs:* but anyway didnt
> figured out any syntax i could use :(
select to_tsquery('dc2', 'kriev:*') || to_tsquery('english', 'kriev:*');
>
> Thanks
>
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru)
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
From | Date | Subject | |
---|---|---|---|
Next Message | Gordon | 2010-08-19 11:19:05 | Extract created and last modified data |
Previous Message | Oleg Bartunov | 2010-08-19 09:11:50 | Re: FTS wildcard and custom ispell dictionary problem |