Forum
Blog result_excerpt In Search Results Not Showing Keyword
When using perch_content_search
to search blog posts, the result_excerpt
is always the first x numbers of characters (specified by excerpt-chars
) for the post, instead of the snippet of text including the matching the keyword.
I've compared this with a site where search happens on a collection and the result_excerpt
always renders the portion of text containing the keyword.
Diagnostics:
Perch Runway: 3.0.14
Production mode: Production (100)
Installed apps: content (3.0.14), assets (3.0.14), categories (3.0.14), perch_blog (5.6.1), perch_forms (1.10), perch_gallery (2.8.9), perch_mailchimp (3.1)
DB driver: PDO
DB tables: perch2_backup_plans (1), perch2_backup_resources (0), perch2_backup_runs (1), perch2_blog_authors (2), perch2_blog_categories (2), perch2_blog_comments (611), perch2_blog_index (9328), perch2_blog_posts (198), perch2_blog_posts_to_categories (20), perch2_blog_posts_to_tags (1547), perch2_blog_sections (1), perch2_blog_tags (1389), perch2_blog_webmention_queue (0), perch2_blogs (2), perch2_categories (76), perch2_category_counts (68), perch2_category_sets (2), perch2_collection_index (0), perch2_collection_items (0), perch2_collection_revisions (0), perch2_collections (0), perch2_content_index (237), perch2_content_items (142), perch2_content_locks (0), perch2_content_regions (21), perch2_forms (1), perch2_forms_responses (430), perch2_gallery_albums (27), perch2_gallery_image_versions (2140), perch2_gallery_images (428), perch2_mailchimp_campaigns (1), perch2_mailchimp_history (2), perch2_mailchimp_log (0), perch2_mailchimp_stats (1), perch2_mailchimp_subscribers (0), perch2_menu_items (12), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_routes (8), perch2_page_templates (9), perch2_pages (19), perch2_resource_log (1459), perch2_resource_tags (0), perch2_resources (5383), perch2_resources_to_tags (0), perch2_settings (48), perch2_user_passwords (0), perch2_user_privileges (49), perch2_user_role_buckets (0), perch2_user_role_privileges (37), perch2_user_roles (2), perch2_users (2)
Users: 2
App runtimes:
<?php
$apps_list = [
'perch_blog',
'perch_forms',
'perch_gallery',
'perch_mailchimp'
];
?>
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins), publish_posts (1 mins), process_webmentions (1 mins)
Scheduled tasks for perch_mailchimp: import_data (1 mins)
Scheduled tasks for Backup: plan_1 (10 mins)
Editor plug-ins: config.js, markitup
H1: 816904f40e90bfebf027bc879a96658e
L1: bdaed9b718968b0cc33c7ad7d2f83b15
F1: 3b606135b33e6a102526838f4152a807
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 1
lang: en-gb
update_2.4.2: done
latest_version:
headerScheme: light
perch_gallery_bucket_mode: single
perch_gallery_bucket: default
perch_blog_post_url: journal/{postSlug}
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_comment_notify: 1
perch_blog_max_spam_days: 7
dashboard: 1
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_gallery_basicUpload: 0
logoPath: /admin/resources/logo.png
perch_gallery_update: 2.8.5
perch_blog_update: 5.6
update_2.7.4: done
update_2.8.15: done
hide_pwd_reset: 0
perch_mailchimp_secret: d8d4ac1b1f8e63c0be67ed230a3eebb5
perch_mailchimp_update: 2.0
perch_blog_site_name:
perch_mailchimp_api_key: b6cdc3bf849fff74703a6a5857b69819-us12
perch_mailchimp_campaign_url: /mailchimp/campaign.php?s={campaignSlug}
perch_mailchimp_list_id: cd1f1471d1
update_2.8.18: done
update_2.8.24: done
update_2.8.31: done
update_3.0.14: done
update_runway_3.0.14: done
on_sale_version: 3.0.14
sidebar_back_link: 0
keyboardShortcuts: 0
siteOffline: 0
content_skip_region_list: 0
assets_restrict_buckets: 0
perch_blog_webmention_tx: 0
perch_blog_webmention_rx: 0
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_DATABASE: perch_et_loc
PERCH_DB_SERVER: localhost
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: web@experiencedtraveller.co.uk
PERCH_EMAIL_FROM_NAME: Experienced Traveller
PERCH_LOGINPATH: /admin
PERCH_PATH: /Users/toby/Sites/experienced-traveller/admin
PERCH_CORE: /Users/toby/Sites/experienced-traveller/admin/core
PERCH_RESFILEPATH: /Users/toby/Sites/experienced-traveller/admin/resources
PERCH_RESPATH: /admin/resources
PERCH_HTML5: 1
PERCH_CUSTOM_EDITOR_CONFIGS: 1
PERCH_RUNWAY: 1
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_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_ASSET_VERSION: f704e7442d11292c99b5
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/toby/Sites/experienced-traveller/admin/templates
PERCH_TEMPLATE_FILTERS:
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_XHTML_MARKUP:
PERCH_RWD: 1
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_DEFAULT_BUCKET: default
PERCH_TRANSLATION_ASSIST:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_PRIV_ASSIST:
PERCH_ENABLE_EXIF: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: markdown
Hosting settings
PHP: 7.2.1
Zend: 3.2.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
MySQL server: 5.6.38
Free disk space: 192.75 GB
Extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysqli, SimpleXML, soap, sockets, sodium, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, gettext, pgsql, pdo_pgsql, igbinary, memcached
GD: Yes
ImageMagick: No
PHP max upload size: 32M
PHP max form post size: 8M
PHP memory limit: 128M
Total max uploadable file size: 8M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
HTTP_HOST: exp-traveller.loc:8888
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
HTTP_REFERER: https://exp-traveller.loc:8888/admin/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-GB,en-US;q=0.9,en;q=0.8
HTTP_COOKIE: cmsa=1; __utmc=266091227; __utmz=266091227.1519745099.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=266091227.1338086403.1519745099.1519818834.1519903281.4; PHPSESSID=ihdpg8bgcvoiddvo2iatfb73ko
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache
SERVER_NAME: exp-traveller.loc
SERVER_ADDR: ::1
SERVER_PORT: 8888
REMOTE_ADDR: ::1
DOCUMENT_ROOT: /Users/toby/Sites/experienced-traveller
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/toby/Sites/experienced-traveller/admin/core/settings/diagnostics/index.php
REMOTE_PORT: 51283
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /admin/core/settings/diagnostics/?extended
SCRIPT_NAME: /admin/core/settings/diagnostics/index.php
PHP_SELF: /admin/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1520510737.957
REQUEST_TIME: 1520510737
argc: 1
Any thoughts on this one Drew?
It looks like the search result returns the first x characters of the post, and if the keyword appears in that excerpt then it should be highlighted.
Yes that’s how it is working but this differs from searching a collection.
Is search behaviour not designed to be consistent accross conent types?
Obviously the core functionality you pay for is a bit more advanced than what you get in a free add-on.
I'll have a look and see if we can enhance that in a future version.