Re: BUG #13690: Full Text Search with spanish dictionary cannot find some words

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #13690: Full Text Search with spanish dictionary cannot find some words
Дата
Msg-id 33158.1445358098@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #13690: Full Text Search with spanish dictionary cannot find some words  (vtamara@pasosdeJesus.org)
Ответы Re: BUG #13690: Full Text Search with spanish dictionary cannot find some words  (Artur Zakirov <a.zakirov@postgrespro.ru>)
Список pgsql-bugs
vtamara@pasosdeJesus.org writes:
> The following search in english succeeds  (returns 1):

> SELECT  COUNT(*) FROM cat
>         WHERE to_tsvector('english', nombre) @@ to_tsquery('english',
> 'politi:*'
> );

> But fails using the spanish dictionary (returns 0):

> SELECT  COUNT(*) FROM cat
>         WHERE to_tsvector('spanish', nombre) @@ to_tsquery('spanish',
> 'politi:*'
> );

This is because you didn't adjust the wildcard search pattern for the
different stemming rules used in Spanish.  Look at the to_tsvector and
to_tsquery results:

regression=# SELECT to_tsvector('english', nombre) , to_tsquery('english','politi:*') from cat;
       to_tsvector       | to_tsquery
-------------------------+------------
 'politica':1 'social':2 | 'politi':*
(1 row)

regression=# SELECT to_tsvector('spanish', nombre) , to_tsquery('spanish','politi:*') from cat;
     to_tsvector      | to_tsquery
----------------------+------------
 'polit':1 'social':2 | 'politi':*
(1 row)

I don't know enough Spanish to follow the reasoning for stemming
"politica" as "polit" rather than something else; but I do see that
"politi" is not reduced to "polit", which is fairly reasonable since
that's not a word.  "politi:*" will match anything whose stemmed
version starts with "politi", but that's too long ...

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13689: Build failed pg9.4.5 with mingw5.1
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #13688: lack of return value in r_mark_regions()