Skip site navigation (1) Skip section navigation (2)

Re: tsearch2 problem

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Jodok Batlogg <jodok(at)lovelysystems(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch2 problem
Date: 2008-10-31 10:10:20
Message-ID: Pine.LNX.4.64.0810311308191.15810@sn.sai.msu.ru (view raw or flat)
Thread:
Lists: pgsql-general
Jodok,

you got what's you defined. Please, read documentation.
In short, word doesn't indexed if it is not recognized by any
dictionaried from stack of dictionaries. Put stemming dictionary at the end,
which recognizes everything.

Oleg
On Fri, 31 Oct 2008, Jodok Batlogg wrote:

> we're using tsearch2 with the german dictionary
> http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/dicts/ispell/ispell-german-compound.tar.gz
> for fulltext search.
>
> the indexing is configured as follows:
>
> CREATE TEXT SEARCH DICTIONARY public.german (
>    TEMPLATE = ispell,
>    DictFile = german,
>    AffFile = german,
>    StopWords = german
> );
>
> CREATE TEXT SEARCH CONFIGURATION public.default ( COPY = pg_catalog.german );
>
> ALTER TEXT SEARCH CONFIGURATION public.default
>    ALTER MAPPING FOR asciiword, asciihword, hword_asciipart,
>                      word, hword, hword_part
>    WITH public.german;
>
> -------------------------
>
> select * from ts_debug('default', 'hundshЪЪtte');
> works as expected: creates the two lexemes: "{hund,hЪЪtte}"
>
> BUT
>
> SELECT to_tsvector('default','lovely und bauarbeiter/in');
> looses a lot of stuff:
> "'bauarbeiter/in':2"
>
> some more debugging shows:
>
> SELECT * from ts_debug('default','lovely und bauarbeiter/in');
>
> "asciiword";"Word, all ASCII";"lovely";"{german}";"german";""
> "blank";"Space symbols";" ";"{}";"";""
> "asciiword";"Word, all ASCII";"und";"{german}";"german";"{}"
> "blank";"Space symbols";" ";"{}";"";""
> "file";"File or path
> name";"bauarbeiter/in";"{simple}";"simple";"{bauarbeiter/in}"
>
> a) unknown words are just beeing dropped
> b) words with slashes are interpreted as file paths and the first path
> is beeing dropped.
>
> any idea how we can fix this?
>
> jodok
>
>

 	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

In response to

Responses

pgsql-general by date

Next:From: Jodok BatloggDate: 2008-10-31 10:30:09
Subject: Re: tsearch2 problem
Previous:From: Nick MellorDate: 2008-10-31 09:13:00
Subject: Re: Slow query performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group