Forum

Thread tagged as: Problem, Addons, Blog

Blog posts not appearing in search results

Hello,

I recently installed the Blog addon, however for some reason any of the blog posts are not showing up in the Perch search results.

I'm not sure if something has been broken in the installation, however I did try removing the blog addon and reinstalling it, however this doesn't seem to have made any difference?

There was some confusion following the video guide on how to install the blog as it looks like the categories have changed - and I'm not sure if I deleted something here that was called 'posts' if I recall correctly? It doesn't seem to show up once again though after a reinstall.

PERCH INFORMATION

Perch: 2.6.6
Production mode: Production (100)
Installed apps: content (2.6.6), assets (2.6.6), categories (2.6.6), perch_blog (4.5.2)
DB driver: PDO
DB tables: perch2_blog_authors, perch2_blog_comments, perch2_blog_index, perch2_blog_posts, perch2_blog_posts_to_tags, perch2_blog_sections, perch2_blog_tags, perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 4
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_blog'
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: redactor, markitup
H1: 62f53ebca312bb287283cfb6b856f404
L1: 5d7165bf6c7a940a4569415b93391e55
headerColour: #0063a7
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 0
lang: en-gb
update_2.6.6: done
latest_version: 2.5.3
on_sale_version: 2.6.6
headerScheme: dark
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
logoPath: /control/resources/logo.png
perch_blog_update: 5.0
perch_blog_post_url: /news/post.php?s={postSlug}
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_blog_comment_notify: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: [removed]_control
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: [removed]_control
PERCH_DB_PREFIX: perch2_
PERCH_TZ: UTC
PERCH_EMAIL_FROM: [removed]
PERCH_EMAIL_FROM_NAME: Joel Stanford
PERCH_LOGINPATH: /control
PERCH_PATH: /home/[removed]/control
PERCH_CORE: /home/[removed]/control/core
PERCH_RESFILEPATH: /home/[removed]/assets/files
PERCH_RESPATH: /assets/files
PERCH_HTML5: 1
PERCH_SCHEDULE_SECRET: [removed]
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home/[removed]/control/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
HOSTING SETTINGS

PHP: 5.4.32
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.5.38-35.2
MySQL server: 5.5.38-35.2
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, SPL, iconv, session, intl, json, mbstring, mcrypt, mssql, mysql, mysqli, odbc, standard, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, imagick, SourceGuardian, mhash, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: Yes
PHP max upload size: 64M
PHP max form post size: 64M
PHP memory limit: 256M
Total max uploadable file size: 64M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
AUTH_TYPE: Basic
DOCUMENT_ROOT: /home/[removed]
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip,deflate,sdch
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8,en-GB;q=0.6
HTTP_CONNECTION: close
HTTP_COOKIE: [removed]; cmsa=1
HTTP_HOST: [removed]
HTTP_REFERER: https://[removed]/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.101 Safari/537.36
HTTP_X_HTTP_PROTO: HTTP/1.1
HTTP_X_REAL_IP: [removed]
PATH: /bin:/usr/bin
PHP_AUTH_PW: [removed]
PHP_AUTH_USER: [removed]
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: [removed]
REMOTE_PORT: 16544
REMOTE_USER: [removed]
REQUEST_METHOD: GET
REQUEST_URI: /control/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home/[removed]/control/core/settings/diagnostics/index.php
SCRIPT_NAME: /control/core/settings/diagnostics/index.php
SERVER_ADDR: [removed]
SERVER_ADMIN: webmaster@[removed]
SERVER_NAME: [removed]
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: <address>Apache Server at [removed] Port 80</address>
SERVER_SOFTWARE: Apache
UNIQUE_ID: VDvQ4cC5U-IAAEcMp3cAAAcq
PHP_SELF: /control/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1413206241.51
REQUEST_TIME: 1413206241
argc: 1
Joel Stanford

Joel Stanford 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you add debug to your search page and let me know what it outputs when you search?

Hi Drew,

So I searched for 'school', and there's definitely a blog article with that in the title and body.

However it doesn't show on the search results page. Here's the debug output:

DIAGNOSTICS:
Search term: school
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
SELECT SQL_CALC_FOUND_ROWS DISTINCT 'content' AS source, MATCH(ci.itemSearch) AGAINST('school') 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('school') OR MATCH(ci.itemSearch) AGAINST('school') )
AND r.regionPage LIKE '/%' 
UNION 
SELECT 'PerchBlog_SearchHandler' AS source, MATCH(postTitle, postDescRaw, postTags) AGAINST('school') AS score, postTitle, postSlug, postDateTime, postDescHTML, postID, sectionSlug, "", ""
FROM perch2_blog_posts p, perch2_blog_sections s
WHERE postStatus='Published'
AND postDateTime<'2014-10-13 15:14:18'
AND p.sectionID=s.sectionID
AND MATCH(postTitle, postDescRaw, postTags) AGAINST('school') 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

Thanks

Just trying to look through myself, and noticed I don't have anything under 'sections' for blog, despite it being in the SQL query.

https://i.imgur.com/E6iQJno.png

Is this the issue (and if so, what should the section be?)

Thanks!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Add a section called something like 'Posts' if you don't otherwise want to section your posts. Then assign you post to that section.

All fixed after adding a section, and then quickly diving into MySQL to ensure blog post section IDs matched the section ID. Thanks!