Re: Convert Simple Query into tsvector & tsquery format.
От | Ivan Sergio Borgonovo |
---|---|
Тема | Re: Convert Simple Query into tsvector & tsquery format. |
Дата | |
Msg-id | 20110318112111.1f3c9e0f@dawn.webthatworks.it обсуждение исходный текст |
Ответ на | Convert Simple Query into tsvector & tsquery format. (Adarsh Sharma <adarsh.sharma@orkash.com>) |
Список | pgsql-general |
On Fri, 18 Mar 2011 12:30:50 +0530 Adarsh Sharma <adarsh.sharma@orkash.com> wrote: > Dear all, > > I have a simple query mentioned below : > > select count(*) from page_content where (content like > '%Militant%' OR content like '%jihad%' OR content like > '%Mujahid%' OR content like '%fedayeen%' OR content like > '%insurgent%' OR content like '%terrORist%' OR > content like '%cadre%' OR content like '%civilians%' OR content > like '%police%' OR content like '%defence%' OR content like > '%cops%' OR content like '%crpf%' OR content like '%dsf%' OR > content like '%ssb%') AND (content like '%kill%' OR content like > '%injure%'); It's not clear where the problem is. select to_tsquery('english', '(yellow | blue) & (red | black)'); to_tsquery --------------------------------------------- ( 'yellow' | 'blue' ) & ( 'red' | 'black' ) select to_tsvector('english', 'yellow red') @@ to_tsquery('english', '(yellow | blue) & (red | black)'); The only thing I can see that could cause problems is you may have previously "mangled" words in the ilike query while you'd leave that task to ts engine that will find a proper lexeme. Could you be more specific about the problem you're encountering. -- Ivan Sergio Borgonovo http://www.webthatworks.it
В списке pgsql-general по дате отправления: