Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id BFDF92E0050 for ; Wed, 18 Jun 2008 10:19:38 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 52700-07 for ; Wed, 18 Jun 2008 10:19:29 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sn.sai.msu.ru (sn.sai.msu.ru [195.208.220.215]) by developer.postgresql.org (Postfix) with ESMTP id 607D72E004D for ; Wed, 18 Jun 2008 10:19:31 -0300 (ADT) Received: from sn.sai.msu.ru (localhost [127.0.0.1]) by sn.sai.msu.ru (8.14.1/8.12.8) with ESMTP id m5IDJOZU007003; Wed, 18 Jun 2008 17:19:24 +0400 Received: from localhost (megera@localhost) by sn.sai.msu.ru (8.14.1/8.12.8/Submit) with ESMTP id m5IDJOCI007000; Wed, 18 Jun 2008 17:19:24 +0400 X-Authentication-Warning: sn.sai.msu.ru: megera owned process doing -bs Date: Wed, 18 Jun 2008 17:19:24 +0400 (MSD) From: Oleg Bartunov X-X-Sender: megera@sn.sai.msu.ru To: Sabbiolina cc: pgsql-admin@postgresql.org Subject: Re: full-text search question In-Reply-To: <269b27950806180549k323833c7n38a0d9f434542bf2@mail.gmail.com> Message-ID: References: <269b27950806180549k323833c7n38a0d9f434542bf2@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.108 tagged_above=0 required=5 tests=AWL=-1.017, DNS_FROM_RFC_BOGUSMX=2.125, RCVD_IN_DNSWL_LOW=-1 X-Spam-Level: X-Archive-Number: 200806/138 X-Sequence-Number: 29476 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