In testing with the "Weight results by date" setting enabled, old content can still surface to the top of the search results in the default sum boost_mode.
Steps to Reproduce
Need to test with a site that has old content.
In our test case a query was bringing up a result in position 2 with a post date from 2009, which was not wanted. The client wanted to deprioritize older content.
In an attempt to fix the issue the "Weight results by date" setting was enabled under WP Dashboard > ElasticPress > Features
Search results were unaffected after the setting update and the post from 2009 was still coming up in position 2
epwr_decay filter was tested with values of both .01 and .99. The original score for the problematic post was 127.52049. Changing decay to .99 changed the post's score to 127.56469 and changing the decay to .01 changed the posts score to 127.52049
Using either end of the epwr_decay didn't change the results of at least the first 14 posts with the test query and the posts that did shift seemed very minor. The following results also showed old content from a mix of years such as 2013 and 2017 in no obvious date order.
On a recommendation from Vasken of using a boost_mode of multiply instead of sum, the results changed drastically and were much more inline with what was expected. The 2009 post was no longer appearing in the first page of the results and the other posts were both relevant and recent.
To confirm the multiply swap I disabled the "Weight results by date" setting and the 2009 post came right back up to position 2. Re-enabling pushed it out.
Expected behavior
The expected behavior is to decay old content. Results that are older than two weeks old should have significantly decreased scores to make them less relevant.
Screenshots
"Weight results by date" setting enabled with default sum mode:
</details>
**Additional context**
In Slack Vasken indicated that the default should probably be switched to `multiply` and that it needs to be reviewed.
Describe the bug
In testing with the "Weight results by date" setting enabled, old content can still surface to the top of the search results in the default
sum
boost_mode.Steps to Reproduce
Need to test with a site that has old content.
epwr_decay
filter was tested with values of both.01
and.99
. The original score for the problematic post was127.52049
. Changing decay to.99
changed the post's score to127.56469
and changing the decay to.01
changed the posts score to127.52049
epwr_decay
didn't change the results of at least the first 14 posts with the test query and the posts that did shift seemed very minor. The following results also showed old content from a mix of years such as 2013 and 2017 in no obvious date order.boost_mode
ofmultiply
instead ofsum
, the results changed drastically and were much more inline with what was expected. The 2009 post was no longer appearing in the first page of the results and the other posts were both relevant and recent.multiply
swap I disabled the "Weight results by date" setting and the 2009 post came right back up to position 2. Re-enabling pushed it out.Expected behavior
The expected behavior is to decay old content. Results that are older than two weeks old should have significantly decreased scores to make them less relevant.
Screenshots
"Weight results by date" setting enabled with default
sum
mode:epwr_decay
value of.01
:epwr_decay
value of.99
:Environment information
Site Health Info:
``` ### wp-core ###version: 5.5.2 site_language: en_US user_language: en_US timezone: America/Los_Angeles permalink: /%postname%/ https_status: true multisite: true user_registration: false blog_public: 1 default_comment_status: open environment_type: production user_count: 89579 site_count: 4 network_count: 1 dotorg_communication: true
wp-active-theme
name: eCorner WordPress Theme (ecorner-stanford) version: 0.1.0 author: 10up author_website: http://10up.com parent_theme: none theme_features: core-block-patterns, post-thumbnails, title-tag, videos, podcasts, snippets, articles, audience, partnership, contributors, html5, collections, quarters, user-collections, email, elasticpress, twitter, remove-comments, mailchimp, category-curation, events, menus, editor-style theme_path: /var/www/html/wp-content/themes/ecorner-stanford auto_update: Disabled
wp-themes-inactive (2)
SEN Website Theme: version: 1.0, author: Danielle Steussy,Auto-updates disabled STVP Theme: version: 1.0, author: Danielle Steussy,Auto-updates disabled
wp-mu-plugins (2)
10up SSO Client: version: 1.0.0, author: 10up Inc eCorner Stanford Core Plugin: version: 0.1.0, author: 10up
wp-plugins-active (12)
10up Experience: version: 1.7.3, author: 10up (latest version: 1.8.0), Auto-updates disabled Column Shortcodes: version: 1.0.1, author: Codepress, Auto-updates disabled Debug Bar: version: 1.0.1, author: wordpressdotorg (latest version: 1.1.2), Auto-updates disabled Debug Bar ElasticPress: version: 1.4, author: 10up, Auto-updates disabled ElasticPress: version: 3.5.2, author: 10up, Auto-updates disabled Rewrite Rules Inspector: version: 1.2.1, author: Daniel Bachhuber, Automattic, Auto-updates disabled S3 Uploads: version: 2.2.2, author: Human Made Limited, Auto-updates disabled Safe Redirect Manager: version: 1.9.2, author: 10up (latest version: 1.10.0), Auto-updates disabled The Events Calendar: version: 5.3.1, author: Modern Tribe, Inc. (latest version: 5.3.1.1), Auto-updates disabled The Events Calendar PRO: version: 5.1.6, author: Modern Tribe, Inc. (latest version: 5.2.1.2), Auto-updates disabled WP Better Emails: version: 0.3, author: Nicolas Lemoine (latest version: 0.4), Auto-updates disabled Yoast SEO: version: 15.2, author: Team Yoast (latest version: 15.6.2), Auto-updates disabled
wp-plugins-inactive (33)
Akismet Anti-Spam: version: 4.1.6, author: Automattic (latest version: 4.1.8), Auto-updates disabled Custom Post Type UI: version: 1.8.0, author: WebDevStudios (latest version: 1.8.2), Auto-updates disabled Debug Bar Actions and Filters Addon: version: 1.5.4, author: Subharanjan, Auto-updates disabled Debug Bar List Script & Style Dependencies: version: 1.1, author: Per Soderlind, Auto-updates disabled Debug Bar Post Types: version: 2.0.0, author: Juliette Reinders Folmer, Auto-updates disabled Extra Menu Item Attributes: version: 0.1, author: Davor Senkovic, Auto-updates disabled Google Analyticator: version: 6.5.4, author: SumoMe, Auto-updates disabled Gravity Forms: version: 2.4.21, author: Gravity Forms, Auto-updates disabled Gravity Forms CSS Ready Class Selector: version: 1.1, author: Brad Vincent, Auto-updates disabled Gravity Forms Digest Bulk Reports: version: 0.3.0, author: Gennady Kovshenin, Auto-updates disabled Gravity Forms Directory: version: 4.2, author: Katz Web Services, Inc., Auto-updates disabled Gravity Forms Mailchimp Add-On: version: 4.8, author: Gravity Forms, Auto-updates disabled Gravity Forms Placeholder Add-On: version: 1.1.0, author: Able Engine, William Wilkerson, Auto-updates disabled Gravity Forms Signature Add-On: version: 3.6, author: Rocketgenius, Auto-updates disabled Gravity Forms Sticky List: version: 1.5.2, author: 13pixar, Auto-updates disabled Gravity Forms Survey Add-On: version: 3.3, author: rocketgenius, Auto-updates disabled Gravity Forms Zapier Add-on: version: 3.3, author: Gravity Forms, Auto-updates disabled ImageMagick Sharpen Resized Images: version: 1.1.7, author: Hans van Eijsden,niwreg, Auto-updates disabled MC4WP: Mailchimp for WordPress: version: 4.8, author: ibericode (latest version: 4.8.2), Auto-updates disabled Memcached: version: 3.2.2, author: Ryan Boren, Denis de Bernardy, Matt Martz, Andy Skelton, Auto-updates disabled P3 (Plugin Performance Profiler): version: 1.5.3.9, author: GoDaddy.com (latest version: 1.5.4), Auto-updates disabled Post Meta Inspector: version: 1.1.1, author: Daniel Bachhuber, Automattic, Auto-updates disabled Query Monitor: version: 3.6.4, author: John Blackbourn (latest version: 3.6.7), Auto-updates disabled Secured Advanced Custom Fields: version: 4.4.3, author: Elliot Condon, secured by 10up, Auto-updates disabled SEN Shortcodes: version: 1.0, author: STVP, Auto-updates disabled ShortCode Redirect: version: 1.0.02, author: Cartpauj, Auto-updates disabled Sign-up Sheets: version: 1.0.13, author: Fetch Designs, Auto-updates disabled Sign-up Sheets Pro: version: 2.1.1, author: DLS Software Studios, Auto-updates disabled STVP Featured Image Extended: version: 1.0, author: Davor Senkovic, senkovic@stanford.edu - STVP, Auto-updates disabled STVP Shortcodes: version: 1.0, author: STVP, Auto-updates disabled User Switching: version: 1.5.5, author: John Blackbourn & contributors (latest version: 1.5.6), Auto-updates disabled WordPress Importer: version: 0.7, author: wordpressdotorg, Auto-updates disabled wpautop-control: version: 1.6, author: Rowan Rodrik van der Molen, Jesse Jacobsen jmatjac@gmail.com., Auto-updates disabled
wp-media
image_editor: WP_Image_Editor_Imagick imagick_module_version: 1690 imagemagick_version: ImageMagick 6.9.10-86 Q16 x86_64 2020-01-13 https://imagemagick.org file_uploads: File uploads is turned off post_max_size: 150m upload_max_filesize: 150m max_effective_size: 150 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 19 GB imagick::RESOURCETYPE_DISK: 9.2233720368548E+18 imagick::RESOURCETYPE_FILE: 786432 imagick::RESOURCETYPE_MAP: 19 GB imagick::RESOURCETYPE_MEMORY: 10 GB imagick::RESOURCETYPE_THREAD: 1 gd_version: 2.2.5 ghostscript_version: not available
wp-server
server_architecture: Linux 4.9.184-linuxkit x86_64 httpd_software: nginx/1.17.7 php_version: 7.4.11 64bit php_sapi: fpm-fcgi max_input_variables: 1000 time_limit: 30 memory_limit: 128M admin_memory_limit: 256M max_input_time: 60 upload_max_filesize: 150m php_post_max_size: 150m curl_version: 7.61.1 OpenSSL/1.1.1c suhosin: false imagick_availability: true pretty_permalinks: true
wp-database
extension: mysqli server_version: 5.7.29 client_version: mysqlnd 7.4.11
wp-constants
WP_HOME: undefined WP_SITEURL: undefined WP_CONTENT_DIR: /var/www/html/wp-content WP_PLUGIN_DIR: /var/www/html/wp-content/plugins WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: true WP_DEBUG_DISPLAY: false WP_DEBUG_LOG: true SCRIPT_DEBUG: false WP_CACHE: false CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_LOCAL_DEV: undefined DB_CHARSET: utf8 DB_COLLATE: undefined
wp-filesystem
wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable mu-plugins: writable