tsearch2 & dictionaries - possible problem

From: Ivan Voras <ivoras(at)freebsd(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: tsearch2 & dictionaries - possible problem
Date: 2010-06-02 10:42:22
Message-ID: hu5ci6$4bn$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

hello,

I think I have a problem with tsearch2 configuration I'm trying to use.
I have created a text search configuration as:

--
CREATE TEXT SEARCH DICTIONARY hr_ispell (
TEMPLATE = ispell,
DictFile = 'hr',
AffFile = 'hr',
StopWords = 'hr'
);

CREATE TEXT SEARCH CONFIGURATION public.ts2hr (COPY=pg_catalog.english);

ALTER TEXT SEARCH CONFIGURATION ts2hr
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart, word,
hword, hword_part
WITH hr_ispell;

SET default_text_search_config = 'public.ts2hr';
--

and here are some queries:

--
cms=> select to_tsvector('voras vorasom');
to_tsvector
-------------

(1 row)

cms=> SET default_text_search_config = 'simple';
SET
cms=> select to_tsvector('voras vorasom');
to_tsvector
-----------------------
'voras':1 'vorasom':2
(1 row)

cms=> SET default_text_search_config = 'ts2hr';
SET
cms=> select to_tsvector('voras vorasom');
to_tsvector
-------------

(1 row)

cms=> select to_tsvector('kiša kiši');
to_tsvector
-------------
'kiša':1,2
(1 row)
--

The good news is that the text search configuration is actually used
(the 'kiša kiši') example but apparently on an uncommon word,
to_tsvector() returns nothing (the 'voras vorasom' example).

Is there something wrong in the configuration? I would definitely not
want unknown words to be ignored.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Geoghegan 2010-06-02 11:17:17 Re: server-side extension in c++
Previous Message Raymond O'Donnell 2010-06-02 09:56:26 Re: How do we get the Client-Time and Server-Time from psql ?