Full text search query build
Iam work on full text search build out.
Im having issue on how to check the 'not' condition.
Ex:
If the user give giri and hari as search term ,then i build the searc开发者_如何学Goh terms as giri & hari and perform search.
If the user give giri not hari as search term ,then how should i build the search term.
Thanks
Match both: giri & hari, match first not second: giri & !hari
SELECT
*
FROM
tablename
WHERE
to_tsvector(colname) @@ (to_tsquery('giri') && to_tsquery('!hari'));
精彩评论