I use the query below for searching,
SELECT
pg_id AS ID,
pg_url AS URL,
pg_title AS Title,
pg_content_1 AS Content_1,
pg_content_2 AS Content_2,
parent_id AS Parent_id,
EXTRACT(DAY FROM pg_created) AS Date,
EXTRACT(MONTH FROM pg_created) AS Month,
EXTRACT(YEAR FROM pg_created) AS Year
FROM root_pages
WHERE root_pages.pg_cat_id = '2'
AND root_pages.parent_id != root_pages.pg_id
AND root_pages.pg_hide != '1'
AND root_pages.pg_url != 'cms'
AND root_pages.pg_content_1 REGEXP '[[:<:]]".$search."[[:>:]]'
OR root_pages.pg_content_2 REGEXP '[[:<:]]".$search."[[:>:]]'
ORDER BY root_pages.pg_created DESC
I works fine but I don't want it to search the keyword in the URL address such as,
If I search for the keyword of home, the query will search any matches of 'home' in the URLs below and return them as the result too:
http://epp.eurostat.ec.europa.eu/xx/eurostat/home/
http://ec.europa.eu/home-affairs/doc_centre/xx.pdf
How can I fix the query so that it won't match the keyword in an URL or it should match the whole word only?
Thanks.