Forum

Thread tagged as: Problem

Search Blog Content

Is there any reason why only my main pages come up in the search results. I have just around 100 posts in the perch blog but none of these feature in any search results.!

Richard Lowe

Richard Lowe 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

No, there shouldn't be a reason. Can you show me the debug output from your search results page?

Richard Lowe

Richard Lowe 0 points
Registered Developer

Debug Message
SELECT * FROM perch2_pages WHERE pagePath='/search/index.php' LIMIT 1
SELECT * FROM perch2_pages WHERE pagePath='/search/index.php' LIMIT 1
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
Using template: /templates/search/search-form.html
SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=3 ORDER BY pageTreePosition ASC
SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/search/index.php' LIMIT 1
SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-013', '000')
Using template: /templates/navigation/item.html
SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/search/index.php' OR regionPage='*' ORDER BY regionPage DESC
Search term: teacher
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
SELECT SQL_CALC_FOUND_ROWS DISTINCT 'PerchContent_SearchHandler' AS source, MATCH(ci.itemSearch) AGAINST('teacher') 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('teacher') OR MATCH(ci.itemSearch) AGAINST('teacher') ) AND r.regionPage LIKE '/%' UNION SELECT 'PerchEvents_SearchHandler' AS source, MATCH(eventTitle, eventDescRaw) AGAINST('teacher') AS score, eventTitle, eventSlug, eventDateTime, eventDescHTML, eventID, "", "", "" FROM perch2_events WHERE eventDateTime>'2015-01-16 06:48:38' AND MATCH(eventTitle, eventDescRaw) AGAINST('teacher') UNION SELECT 'PerchBlog_SearchHandler' AS source, MATCH(postTitle, postDescRaw, postTags) AGAINST('teacher') AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", "" FROM perch2_blog_posts p, perch2_blog_sections s WHERE postStatus='Published' AND postDateTime<'2015-01-16 06:48:38' AND p.sectionID=s.sectionID AND MATCH(postTitle, postDescRaw, postTags) AGAINST('teacher') ORDER BY score DESC LIMIT 0, 10
SELECT FOUND_ROWS() AS `count`
Using template: /templates/search/search-result.html
Using template: /templates/search/search-form.html
Drew McLellan

Drew McLellan 2638 points
Perch Support

It's certainly searching blog content. Would you expect 'teacher' to match some, but not more than half?

Richard Lowe

Richard Lowe 0 points
Registered Developer

https://dev.besteverwebsite.co.uk/blog/

You can test for yourself and see debug...

Look at any post and then search some of the content, certainly teacher should come up. Does it matter that I have many categories within the blog. Do I need to add any Sections?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You have at least once section, right?

Richard Lowe

Richard Lowe 0 points
Registered Developer

Yes, just called default, but it says there are no posts in it and it is not available to select on an individual post

Drew McLellan

Drew McLellan 2638 points
Perch Support

That sounds odd. Was this a fresh install, or an update from an older version?

Richard Lowe

Richard Lowe 0 points
Registered Developer

I updated it whilst building it but only from the very previous version.

Richard Lowe

Richard Lowe 0 points
Registered Developer

I think I've just found a solution, I added a further section and now I can see an option to select the section 'default' this now allows me so 'see' the sections options. I have test with a new post entry and now this new post is searchable. Although is there any whay I can now batch add all the blog posts to the 'default' section

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's not, I'm afraid. I'll log this as a bug.

Richard Lowe

Richard Lowe 0 points
Registered Developer

No problem, thanks anyway, it's such a good platform that I look over the bugs ;-)