WordPress.org

Making WordPress.org

Changeset 4333


Ignore:
Timestamp:
11/07/2016 04:02:57 AM (21 months ago)
Author:
tellyworth
Message:

Plugin directory search: fix linear function score and remove ngram fields as suggested by @gibrown

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

    r4174 r4333  
    282282        $locale = get_locale();
    283283        if ( $locale && $locale !== 'en' && $locale !== 'en_US' ) {
    284             $es_wp_query_args['query_fields'] = array( "title_{$locale}_ngram^4", 'title_en_ngram^0.5', "content_{$locale}_ngram^2", 'content_en_ngram^0.5', "excerpt_{$locale}_ngram", 'excerpt_en_ngram', 'author', 'tag', 'category', 'slug_ngram', 'contributors' );
     284            $es_wp_query_args['query_fields'] = array( "title_{$locale}^4", 'title_en^0.5', "content_{$locale}^2", 'content_en^0.5', "excerpt_{$locale}", 'excerpt_en', 'author', 'tag', 'category', 'slug_ngram', 'contributors' );
    285285        } else {
    286             $es_wp_query_args['query_fields'] = array( 'title_en_ngram^4', 'content_en_ngram^2', 'excerpt_en_ngram', 'author', 'tag', 'category', 'slug_ngram', 'contributors' );
     286            $es_wp_query_args['query_fields'] = array( 'title_en^4', 'content_en^2', 'excerpt_en', 'author', 'tag', 'category', 'slug_ngram', 'contributors' );
    287287        }
    288288
     
    728728                                         'scale' => $date_scale,
    729729                                         'decay' => $date_decay,
    730                                      ) ) ,
     730                                     ) )
     731                                 ),
     732                             array(
    731733                                 'linear' => array(
    732734                                     'tested' => array(
Note: See TracChangeset for help on using the changeset viewer.