Full text search prefix matching

Поиск
Список
Период
Сортировка
От Heikki Rauhala
Тема Full text search prefix matching
Дата
Msg-id 2FE04E1C-13DC-4066-B29B-1E783CD77C8A@reaktor.fi
обсуждение исходный текст
Ответы Re: Full text search prefix matching  (Vincent Veyron <vv.lists@wanadoo.fr>)
Re: Full text search prefix matching  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi,

I’m trying to use PostgreSQL's full text search for searching names with prefix matching. I’ve got a materialized view
withthe  tsvector’s in an indexed column which I’m then searching with prefix matching, as in the sqlfiddle:
http://sqlfiddle.com/#!15/a2389/6and below. 

My problem is that when using the ‘finnish’ text search configuration, the names are split before the end, and they’re
notmatched when searching with prefix search that has exactly one character more than the lexeme, as also demonstrated
inthe above fiddle. When there are two characters after the lexeme, it does match. 

I’m working around the issue by using ‘simple’ configuration, which includes the full words in the lexemes.

Should text search prefixes work predicatably as documented in [1] even if the lexemes are shorter than the query? How
canI get it to work? 

Best regards,

Heikki Rauhala


[1] http://www.postgresql.org/docs/9.3/static/textsearch-controls.html#TEXTSEARCH-PARSING-QUERIES

create table names (name varchar);
insert into names (name) values ('Sofia');

create materialized view name_fulltext as
  select
    name,
    to_tsvector('finnish', name) as
      searchable_index_col
  from names;

select * from name_fulltext;
select to_tsquery('finnish','sof:*');

select 'found sof', name
from name_fulltext
where searchable_index_col@@to_tsquery('finnish','sof:*');

select 'notfound sofi', name
from name_fulltext
where searchable_index_col@@to_tsquery('finnish','sofi:*');

select 'found sofia', name
from name_fulltext
where searchable_index_col@@to_tsquery('finnish','sofia:*');

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

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: 9.3.5 failing to compile with dtrace on FreeBSD 10.1
Следующее
От: Vick Khera
Дата:
Сообщение: Re: 9.3.5 failing to compile with dtrace on FreeBSD 10.1