Re: Text search

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Text search
Дата
Msg-id 4B9F77B9.7080104@archonet.com
обсуждение исходный текст
Ответ на Text search  (Chris Roffler <croffler@earthlink.net>)
Ответы Re: Text search  (Chris Roffler <croffler@earthlink.net>)
Список pgsql-general
On 16/03/10 10:29, Chris Roffler wrote:
> I have a text column in a table. We store XML in this column. Now I want to
> search for tags and values

> 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 ?

Would you not be better off with an XML data-type if that's how you want
to treat the data?
http://www.postgresql.org/docs/8.4/static/datatype-xml.html
http://www.postgresql.org/docs/8.4/static/functions-xml.html
http://www.postgresql.org/docs/8.4/static/xml2.html

--
   Richard Huxton
   Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Schmidtke
Дата:
Сообщение: reuse data in existing data directory
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: reuse data in existing data directory