10up / ElasticPress

A fast and flexible search and query engine for WordPress.
https://elasticpress.io
GNU General Public License v2.0
1.25k stars 311 forks source link

Decay provides unexpected results in sum mode #2042

Closed bjorn2404 closed 3 years ago

bjorn2404 commented 3 years ago

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.

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:

image

epwr_decay value of .01:

image

epwr_decay value of .99:

image

Environment information

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


   </details>

**Additional context**
In Slack Vasken indicated that the default should probably be switched to `multiply` and that it needs to be reviewed.
mckdemps commented 3 years ago

@Rahmon https://discuss.elastic.co/t/function-score-gaussian-decay-handling-multiple-by-zero/117086/2

brandwaffle commented 3 years ago

@Rahmon https://discuss.elastic.co/t/function-score-gaussian-decay-handling-multiple-by-zero/117086/2