Making WordPress.org

Changes between Initial Version and Version 3 of Ticket #4450


Ignore:
Timestamp:
05/10/2019 03:22:30 AM (6 years ago)
Author:
dd32
Comment:

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 :
     1I 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]:
    32
     3{{{
    44custom score = e^((ln(decay)/scale) * max(0, |actual_value - origin| - offset))
    55
     
    1111
    1212e^((ln(0.75)/900000) * max(0, |500000 - 1000000| - 0))^ = 0.8522943134
     13}}}
    1314
    1415For 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}}}
    1617
    1718The 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.