Making WordPress.org


Ignore:
Timestamp:
06/20/2016 09:10:01 AM (8 years ago)
Author:
tellyworth
Message:

Tweak search scoring to give better results with current data.

Date scoring is over-sensitive because modified dates currently do not accurately reflect plugin updates.

See #1692.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/libs/site-search/jetpack-search.php

    r3470 r3494  
    444444   
    445445            'query'          => null,    // Search phrase
    446             'query_fields'   => array( 'title^2', 'content', 'author', 'tag', 'category', 'slug_ngram', 'contributors' ),
     446            'query_fields'   => array( 'title_en^2', 'content_en', 'author', 'tag', 'category', 'slug_ngram', 'contributors' ),
    447447   
    448448            'post_type'      => null,  // string or an array
     
    669669    public static function score_query_by_recency( $query ) {
    670670        //Newer content gets weighted slightly higher
    671         $date_scale = '360d';
    672         $date_decay = 0.9;
     671        $date_scale = '720d';
     672        $date_offset = '180d';
     673        $date_decay = 0.95;
    673674        $date_origin = date( 'Y-m-d' );
    674675
     
    683684                                     'date_gmt' => array(
    684685                                         'origin' => $date_origin,
     686                                         'offset' => $date_offset,
    685687                                         'scale' => $date_scale,
    686688                                         'decay' => $date_decay,
     
    691693                                    'field' => 'meta.active_installs.long',
    692694                                    'factor' => 1.0,
    693                                     'modifier' => 'log1p',
     695                                    'modifier' => 'sqrt',
    694696                                ),
    695697                            ),
Note: See TracChangeset for help on using the changeset viewer.