Re: Simplifying Text Search

Поиск
Список
Период
Сортировка
От Trevor Talbot
Тема Re: Simplifying Text Search
Дата
Msg-id 90bce5730711141441s9309846l2ccf7fa4782a5b00@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Simplifying Text Search  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Simplifying Text Search  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On 11/14/07, Peter Eisentraut <peter_e@gmx.net> wrote:
> I wrote:
> > What we'd need is a way to convert a LIKE pattern into a tsquery
> > ('%foo%bar%' => 'foo & bar').  Then you might even be able to sneak
> > index-optimized text search into existing applications.  Might be worth a
> > try.
>
> Here is how this could work:
>
> CREATE FUNCTION likepattern_to_tsquery(text) RETURNS tsquery

[...]

But that coversion itself is fundamentally flawed, is the problem.

'foo bar'
'fooandbar'
'barfoo and foobar'

'%foo%bar%' matches all 3.
'foo & bar' matches only the first.

If the application currently using LIKE actually wants a word-based
search, it should probably just convert to using tsearch wholesale,
since it doesn't work as intended now.  If it actually wants wildcard
matching behavior, it can't use tsearch at all.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Simplifying Text Search
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Simplifying Text Search