Forum
No results from the Search form
I've just upgraded to 2.5 and have no response when Searching. I'm using the vanilla page and forms and searching for expected terms. Any ideas?
I've used it on this site previously and it did work.
I've just upgraded to 2.5 and have no response when Searching. I'm using the vanilla page and forms and searching for expected terms. Any ideas?
I've used it on this site previously and it did work.
If you turn on debug, what does it output?
Okay here's the output:
DIAGNOSTICS: Search term: Using template: /templates/search/search-result.html Using template: /templates/search/search-form.html
Array
(
)
This is on the hosting (rather than on a local server). So is 'Safe Mode' preventing the Search?
No, that error is coming from the generally PHP environment rather than Perch code.
Does the output change if you submit the search form?
Oh okay. This is a bit different:
DIAGNOSTICS: Search term: Jazz SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) SELECT SQL_CALC_FOUND_ROWS DISTINCT 'content' AS source, MATCH(ci.itemSearch) AGAINST() AS score, r.regionPage AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, r.regionOptions AS col4, p.pageNavText AS col5, p.pageTitle AS col6, regionTemplate AS col7, r.regionKey AS col8 FROM perch2_content_regions r, perch2_content_items ci, perch2_pages p WHERE r.regionID=ci.regionID AND r.regionRev=ci.itemRev AND r.pageID=p.pageID AND r.regionPage!='' AND r.regionSearchable=1 AND (MATCH(ci.itemSearch) AGAINST() OR MATCH(ci.itemSearch) AGAINST() ) AND r.regionPage LIKE UNION SELECT 'PerchEvents_SearchHandler' AS source, MATCH(eventTitle, eventDescRaw) AGAINST() AS score, eventTitle, eventSlug, eventDateTime, eventDescHTML, eventID, "", "", "" FROM perch2_events WHERE eventDateTime> AND MATCH(eventTitle, eventDescRaw) AGAINST() UNION SELECT 'PerchBlog_SearchHandler' AS source, MATCH(postTitle, postDescRaw, postTags) AGAINST() AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch2_blog_posts p, perch2_blog_sections s WHERE postStatus='Published' AND postDateTime< AND p.sectionID=s.sectionID AND MATCH(postTitle, postDescRaw, postTags) AGAINST() UNION SELECT 'PerchShop_SearchHandler' AS source, MATCH(productTitle, productDescRaw) AGAINST() AS score, productTitle, productSlug, productPrice, productDescHTML, productID, "", "", "" FROM perch2_shop_products WHERE productStatus='Live' AND MATCH(productTitle, productDescRaw) AGAINST() ORDER BY score DESC LIMIT 0, 10 Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) SELECT SQL_CALC_FOUND_ROWS DISTINCT 'content' AS source, 0-(LENGTH(r.regionPage)-LENGTH(REPLACE(r.regionPage, '/', ''))) AS score, r.regionPage AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, r.regionOptions AS col4, p.pageNavText AS col5, p.pageTitle AS col6, regionTemplate AS col7, r.regionKey AS col8 FROM perch2_content_regions r, perch2_content_items ci, perch2_pages p WHERE r.regionID=ci.regionID AND r.regionRev=ci.itemRev AND r.pageID=p.pageID AND r.regionPage!='' AND r.regionSearchable=1 AND ci.itemSearch REGEXP AND r.regionPage LIKE UNION SELECT 'PerchEvents_SearchHandler' AS source, eventDateTime AS score, eventTitle, eventSlug, eventDateTime, eventDescHTML, eventID, "", "", "" FROM perch2_events WHERE eventDateTime> AND ( concat(" ", eventTitle, " ") REGEXP OR concat(" ", eventDescRaw, " ") REGEXP ) UNION SELECT 'PerchBlog_SearchHandler' AS source, postDateTime AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch2_blog_posts p, perch2_blog_sections s WHERE postStatus='Published' AND postDateTime< AND p.sectionID=s.sectionID AND ( concat(" ", postTitle, " ") REGEXP OR concat(" ", postDescRaw, " ") REGEXP OR concat(" ", postTags, " ") REGEXP ) UNION SELECT 'PerchShop_SearchHandler' AS source, productPrice AS score, productTitle, productSlug, productPrice, productDescHTML, productID, "", "", "" FROM perch2_shop_products WHERE productStatus='Live' AND ( productTitle REGEXP OR productDescRaw REGEXP ) ORDER BY score ASC LIMIT 0, 10 Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) SELECT FOUND_ROWS() AS
count
Could not create DB link! SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Using template: /templates/search/search-result.html Using template: /templates/search/search-form.htmlThe site is working otherwise, other apps are working.
Sorry, ignore that last one.
Uploaded wrong config file.
Here's the correct response:
DIAGNOSTICS: Search term: Jazz SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 SELECT SQL_CALC_FOUND_ROWS DISTINCT 'content' AS source, MATCH(ci.itemSearch) AGAINST('Jazz') AS score, r.regionPage AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, r.regionOptions AS col4, p.pageNavText AS col5, p.pageTitle AS col6, regionTemplate AS col7, r.regionKey AS col8 FROM perch2_content_regions r, perch2_content_items ci, perch2_pages p WHERE r.regionID=ci.regionID AND r.regionRev=ci.itemRev AND r.pageID=p.pageID AND r.regionPage!='' AND r.regionSearchable=1 AND (MATCH(ci.itemSearch) AGAINST('Jazz') OR MATCH(ci.itemSearch) AGAINST('Jazz') ) AND r.regionPage LIKE '/%' UNION SELECT 'PerchEvents_SearchHandler' AS source, MATCH(eventTitle, eventDescRaw) AGAINST('Jazz') AS score, eventTitle, eventSlug, eventDateTime, eventDescHTML, eventID, "", "", "" FROM perch2_events WHERE eventDateTime>'2014-06-27 12:11:19' AND MATCH(eventTitle, eventDescRaw) AGAINST('Jazz') UNION SELECT 'PerchBlog_SearchHandler' AS source, MATCH(postTitle, postDescRaw, postTags) AGAINST('Jazz') AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch2_blog_posts p, perch2_blog_sections s WHERE postStatus='Published' AND postDateTime<'2014-06-27 12:11:19' AND p.sectionID=s.sectionID AND MATCH(postTitle, postDescRaw, postTags) AGAINST('Jazz') UNION SELECT 'PerchShop_SearchHandler' AS source, MATCH(productTitle, productDescRaw) AGAINST('Jazz') AS score, productTitle, productSlug, productPrice, productDescHTML, productID, "", "", "" FROM perch2_shop_products WHERE productStatus='Live' AND MATCH(productTitle, productDescRaw) AGAINST('Jazz') ORDER BY score DESC LIMIT 0, 10 Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'marsdenj_perch.perch2_blog_sections' doesn't exist SELECT SQL_CALC_FOUND_ROWS DISTINCT 'content' AS source, 0-(LENGTH(r.regionPage)-LENGTH(REPLACE(r.regionPage, '/', ''))) AS score, r.regionPage AS col1, ci.itemSearch AS col2, ci.itemJSON AS col3, r.regionOptions AS col4, p.pageNavText AS col5, p.pageTitle AS col6, regionTemplate AS col7, r.regionKey AS col8 FROM perch2_content_regions r, perch2_content_items ci, perch2_pages p WHERE r.regionID=ci.regionID AND r.regionRev=ci.itemRev AND r.pageID=p.pageID AND r.regionPage!='' AND r.regionSearchable=1 AND ci.itemSearch REGEXP '[[:<:]]Jazz[[:>:]]' AND r.regionPage LIKE '/%' UNION SELECT 'PerchEvents_SearchHandler' AS source, eventDateTime AS score, eventTitle, eventSlug, eventDateTime, eventDescHTML, eventID, "", "", "" FROM perch2_events WHERE eventDateTime>'2014-06-27 12:11:19' AND ( concat(" ", eventTitle, " ") REGEXP '[[:<:]]Jazz[[:>:]]' OR concat(" ", eventDescRaw, " ") REGEXP '[[:<:]]Jazz[[:>:]]' ) UNION SELECT 'PerchBlog_SearchHandler' AS source, postDateTime AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch2_blog_posts p, perch2_blog_sections s WHERE postStatus='Published' AND postDateTime<'2014-06-27 12:11:19' AND p.sectionID=s.sectionID AND ( concat(" ", postTitle, " ") REGEXP '[[:<:]]Jazz[[:>:]]' OR concat(" ", postDescRaw, " ") REGEXP '[[:<:]]Jazz[[:>:]]' OR concat(" ", postTags, " ") REGEXP '[[:<:]]Jazz[[:>:]]' ) UNION SELECT 'PerchShop_SearchHandler' AS source, productPrice AS score, productTitle, productSlug, productPrice, productDescHTML, productID, "", "", "" FROM perch2_shop_products WHERE productStatus='Live' AND ( productTitle REGEXP '[[:<:]]Jazz[[:>:]]' OR productDescRaw REGEXP '[[:<:]]Jazz[[:>:]]' ) ORDER BY score ASC LIMIT 0, 10 Invalid query: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'marsdenj_perch.perch2_blog_sections' doesn't exist SELECT FOUND_ROWS() AS
count
Using template: /templates/search/search-result.html Using template: /templates/search/search-form.htmlOkay, figured it out. I just hadn't visited the Blog admin section so it hadn't made the Sections table and presumably that blocked the whole search, even if I tried to restrict the search to Events. As soon as I did that it put in the table and the search worked fine.
Thanks for you help