Re: Full text search strategy for names - Mailing list pgsql-general

From Rick Schumeyer
Subject Re: Full text search strategy for names
Date
Msg-id 95b1cc100904170402j1ac9d355n7c473c026a12b53c@mail.gmail.com
Whole thread Raw
In response to Re: Full text search strategy for names  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Full text search strategy for names
Re: Full text search strategy for names
Re: Full text search strategy for names
List pgsql-general
You can get extra (undesirable) results, depending on the name.  For example, if you are searching for the last name of "Ricks", you will also find all authors whose first name is "Rick".

I also noticed that the directions for indexing multiple columns don't seem to be quite right.

In section 12.2.2:
UPDATE pgweb SET textsearchable_index_col =
to_tsvector('english', coalesce(title,'') || coalesce(body,''));


I found that the last word of title is joined with the first word of body, which gives strange results.  I ended up added a space which gave better results:

 to_tsvector('english', coalesce(title,'') || ' ' || coalesce(body,''));

On Fri, Apr 17, 2009 at 1:04 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Rick Schumeyer <rschumeyer@gmail.com> writes:
> I want to be able to search a list of articles for title words as well as
> author names.  I understand how to do the title words with the full text
> searching.  But I'm not sure the best strategy for the names.  The full text
> parser "parses" the names giving undesirable results.

> For example,

> select to_tsvector('claude Jones');
>     to_tsvector
> --------------------
>  'jone':2 'claud':1

Er ... why is that a problem?  As long as the index stems the words in
the same way that the query does, why should you care?

                       regards, tom lane

pgsql-general by date:

Previous
From: Christian Schröder
Date:
Subject: Re: Performance of full outer join in 8.3
Next
From: Grzegorz Jaśkiewicz
Date:
Subject: Re: Full text search strategy for names