Changes between Initial Version and Version 3 of Ticket #4450
- Timestamp:
- 05/10/2019 03:22:30 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #4450 – Description
initial v3 1 I was recently looking over the [https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/libs/site-search/jetpack-search.php#L1001 source code for the Plugin Repo's Elasticsearch function_score query]. If I understand correctly, it seems like the query penalizes plugins with less than one million active installs, but the comments in the code suggest this should be otherwise. The filter clause in the Elasticsearch query applies the exponential decay scoring function to plugins with less-than-or-equal to 1000000 active installs. The exponential decay scoring function with a plugin with 500000 (five hundred thousand) active installs should look like this when plugging in all the values in accordance with [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#exp-decay Elasticsearch's example] 2 : 1 I was recently looking over the [https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/libs/site-search/jetpack-search.php#L1001 source code for the Plugin Repo's Elasticsearch function_score query]. If I understand correctly, it seems like the query penalizes plugins with less than one million active installs, but the comments in the code suggest this should be otherwise. The filter clause in the Elasticsearch query applies the exponential decay scoring function to plugins with less-than-or-equal to 1000000 active installs. The exponential decay scoring function with a plugin with 500000 (five hundred thousand) active installs should look like this when plugging in all the values in accordance with [https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#exp-decay Elasticsearch's example]: 3 2 3 {{{ 4 4 custom score = e^((ln(decay)/scale) * max(0, |actual_value - origin| - offset)) 5 5 … … 11 11 12 12 e^((ln(0.75)/900000) * max(0, |500000 - 1000000| - 0))^ = 0.8522943134 13 }}} 13 14 14 15 For Google Sheets: 15 EXP(LN(0.75)/900000 * MAX(0, ABS(500000 - 1000000) - 0)) = 0.8522943134 16 {{{EXP(LN(0.75)/900000 * MAX(0, ABS(500000 - 1000000) - 0)) = 0.8522943134}}} 16 17 17 18 The resulting score is multiplied, along with other calculated factors, with the document relevance score Elasticsearch returns based on how well the search input matches the plugin text content. If my understanding of the exponential decay function is correct and if my math is correct, it appears that the resulting relevance document score for the plugin is going to be reduced to 85% of what it should otherwise be. This multiplier is not calculated or applied to plugins with more than 1000000 active installs.