Re: Full text search

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: itishree sukla <itishree(dot)sukla(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Full text search
Date: 2013-07-12 06:44:07
Message-ID: CA+h6AhhaWoC=fMZ_MZ27PQW4VM7_H6vhJCwnAk0rJz5AFLJcgQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 12, 2013 at 11:48 AM, itishree sukla
<itishree(dot)sukla(at)gmail(dot)com>wrote:

> Hello everyone,
>
> I am using full text search, however it is not helping me to get the
> partial value.
>
> For example in my document let Pizza Hut is there, if i am searching for
> Pizza Hut is it giving me the values for only Pizza or a spell mistake like
> pizz is not returning any thing. any work around for this, please suggest.
>
> Regards,
> Itishree
>

Hope you are looking like this.

create table foo(v text);
insert into foo values('Near to my house there\'s no any Pizza Hut
restuarant');
insert into foo values('I wont like pizza, but friends are crazy of it');

postgres=# select * from foo where v ~* 'pizz';
v
------------------------------------------------------
Near to my house there's no any Pizza Hut restuarant
I wont like pizza, but friends are crazy of it
(2 rows)

postgres=# select * from foo where v ~* 'pizza hut';
v
------------------------------------------------------
Near to my house there's no any Pizza Hut restuarant
(1 row)

postgres=# select * from foo where v ~* 'pizza';
v
------------------------------------------------------
Near to my house there's no any Pizza Hut restuarant
I wont like pizza, but friends are crazy of it
(2 rows)

or

with ILIKE

select * from foo where v ilike '%hut%';

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Amit Langote 2013-07-12 07:00:22 Re: How can you get "WAL segment has already been removed" when doing synchronous replication ?!
Previous Message itishree sukla 2013-07-12 06:18:27 Full text search