Re: [despammed] How to search for a subString - Mailing list pgsql-interfaces

From Bruno Wolff III
Subject Re: [despammed] How to search for a subString
Date
Msg-id 20050206133220.GB952@wolff.to
Whole thread Raw
In response to Re: [despammed] How to search for a subString  (Kretschmer Andreas <andreas_kretschmer@despammed.com>)
Responses Re: [despammed] How to search for a subString  (Frank Finner <postgresql@finner.de>)
List pgsql-interfaces
On Sun, Feb 06, 2005 at 11:45:20 +0100, Kretschmer Andreas <andreas_kretschmer@despammed.com> wrote:
> am  Sun, dem 06.02.2005, um  2:12:46 -0800 mailte b t folgendes:
> > Hi, I'm building a database for a school project and I want to search for the
> > name of the movie,  fro example in the database there is a table called movie
> > and has a movie call "The fast and the furious" so if the type in "the fast"
> > then it should return that movie. I tried using like and ilike and it still
> 
> select .. ~ '*the fast*' ...

That should be:
select .. ~ '.*the fast.*' ...

As REs are unanchored, you can simplify this to:
select .. ~ 'the fast' ...

However, ilike should have worked if it was used properly.

Also note that these searches are going to be slow, since they won't
be able to use an index. If you have so many movies that the speed of
the search is unacceptably slow, then you might want to look at the
tsearch2 contrib module.


pgsql-interfaces by date:

Previous
From: Kretschmer Andreas
Date:
Subject: Re: [despammed] How to search for a subString
Next
From: Frank Finner
Date:
Subject: Re: [despammed] How to search for a subString