Text search

From: Chris Roffler <croffler(at)earthlink(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Text search
Date: 2010-03-16 10:29:37
Message-ID: 3984722a1003160329i432e0b53t713756f192c078f4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a text column in a table. We store XML in this column. Now I want to
search for tags and values

Example data:

<bank>
<name>Citi Bank</name>
.....
.....
/<bank>

I would like to run the following query:

select * from xxxx where to_tsvector('english',xml_column) @@
to_tsquery('<name>Citi
Bank</name>')

This works fine but it also works for any tag as long as the name 'Citi
Bank' is present.

How do I have to setup my search in order for this to work so I get an exact
match for the tag and value ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Schmidtke 2010-03-16 12:02:56 reuse data in existing data directory
Previous Message Greg Smith 2010-03-16 07:51:49 Re: hardware for a server