dbTalk Databases Forums  

[SQL] Implement PostgreSQL full text search

mailing.database.pgsql-sql mailing.database.pgsql-sql


Discuss [SQL] Implement PostgreSQL full text search in the mailing.database.pgsql-sql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
-
 
Posts: n/a

Default [SQL] Implement PostgreSQL full text search - 01-12-2011 , 03:14 AM






Hello everyone.
I'm trying to create search with pagination and filters on a website. I
stumbled with the search for the words. It could do with ILIKE but the table
will have many records, was looking at PostgreSQL full text search, but do
not quite understand how to implement. Someone could help me with
implementation?

my select is

SELECT entries. "id" entries. "title" entries. "description" entries.
"price"
FROM
(SELECT ROW_NUMBER () OVER (
ORDER BY items. "date" DESC
) as Row,
items. "id" items. "title" items. "description" items. "price "
FROM items, provinces
WHERE
items. "prov_id" = provinces. "prov_id"
AND items. "prov_id"= 2

- I try to change here for PostgreSQL full text search
AND (items. "description" ILIKE ('% TEST search Postgre%') OR
items. "title" ILIKE ('% search Postgre% TEST'))
) as entries

I want to look for words entered in the title and description columns of the
table.
Thank you very much for any help.



En Espaņol

Hola a todos.
Estoy intentando crear busqueda con paginacion y filtros en una pagina web.
Me tropeze con la busqueda por las palabras. Se podria hacer con ILIKE pero
la tabla va a tener muchos registros, estaba mirando a postgreSQL full text
search, pero no entiendo bien como implementar. Me podria ayudar alquien con
implementacion?

mi select es

SELECT entries."id", entries."title", entries."description", entries."price"
FROM
(SELECT ROW_NUMBER() OVER (
ORDER BY items."date" DESC
) as Row,
items."id", items."title", items."description", items."price"
FROM items, provinces
WHERE
items."prov_id"=provinces."prov_id"
AND items."prov_id"=2

-- I try to change here for postgreSQL full text search
AND (items."description" ILIKE('%TEST search postgre%') OR
items."title" ILIKE('%TEST search postgre%'))
) as entries

Quiero que busque palabras introducidas en las columnas title y description
de la tabla.
Muchas gracias por cualquier ayuda.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.