From: Oleg Bartunov <oleg@sai.msu.su>
To: Sabbiolina <sabbiolina@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: full-text search question
Date: Wed, 18 Jun 2008 17:19:24 +0400 (MSD)
Message-ID: <Pine.LNX.4.64.0806181715270.11363@sn.sai.msu.ru> (raw)
In-Reply-To: <269b27950806180549k323833c7n38a0d9f434542bf2@mail.gmail.com>
References: <269b27950806180549k323833c7n38a0d9f434542bf2@mail.gmail.com>
Sabbiolina,
you have two options:
1. Write you very own parser
2. Write dictionary, which breaks host to parts
Fortunately, you can use our dict_regex dictionary
(http://vo.astronet.ru/arxiv/dict_regex.html) instead of 2.
Oleg
On Wed, 18 Jun 2008, Sabbiolina wrote:
> Hello,
>
>
>
> I've seen that the default parser for the full-text search can identify
> e-mail addresses, hosts, URLs? but I have a serious problem with it:
>
>
>
> Suppose I index the following sentence "the search engine I use the most is
> www.google.com"
>
>
>
> And I search "google" no result is found.
>
> Instead if I search "www.google.com" the record is found correctly.
>
>
>
> I guess the reason is because the parser treats www.google.com as a single
> token (of type 'host') but as everyone can easily see the result of this is
> a major problem. In fact the word "google" actually is in the above
> sentence, and the end-user of the database obviously asks me "why does your
> FTS not find that record when I can clearly see that my search term is
> there?"
>
>
>
> Reading the docs I've seen that the parser can produce multiple tokens for
> the same word (for example the word "make-up" produces 4 tokens: make-up,
> make, -, up)? why not doing the same with URLs and e-mails? Why
> www.google.com is only treated as a unique word? Why not producing multiple
> tokens like www.google.com, www, ., google, ., com? (obviously www and . can
> be nulled or stopworded).
>
>
> Does anybody know of a better parser for Postgres? Or at least a trick to
> make its FTS find the record above by searching only a part of the URL?
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: oleg@sai.msu.su, sabbiolina@gmail.com
Subject: Re: full-text search question
In-Reply-To: <Pine.LNX.4.64.0806181715270.11363@sn.sai.msu.ru>
References: <269b27950806180549k323833c7n38a0d9f434542bf2@mail.gmail.com> <Pine.LNX.4.64.0806181715270.11363@sn.sai.msu.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox