Changeset 3597
- Timestamp:
- 06/26/2016 03:02:20 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/libs/site-search/jetpack-search.php
r3591 r3597 281 281 $locale = get_locale(); 282 282 if ( $locale && $locale !== 'en' && $locale !== 'en_US' ) { 283 $es_wp_query_args['query_fields'] = array( "title_{$locale}^2", 'title_en^0.5', "content_{$locale}^2", 'content_en^0.5', "excerpt_{$locale}", 'excerpt_en', 'author', 'tag', 'category', 'slug_ngram', 'contributors' ); 284 $es_wp_query_args['boost_fields'] = array( "title_{$locale}", 'title_en' ); 283 $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' ); 285 284 } else { 286 $es_wp_query_args['query_fields'] = array( 'title_en^2', 'content_en', 'excerpt_en', 'author', 'tag', 'category', 'slug_ngram', 'contributors' ); 287 $es_wp_query_args['boost_fields'] = array( 'title_en' ); 285 $es_wp_query_args['query_fields'] = array( 'title_en_ngram^4', 'content_en_ngram^2', 'excerpt_en_ngram', 'author', 'tag', 'category', 'slug_ngram', 'contributors' ); 288 286 } 289 287 … … 615 613 ), 616 614 ), 617 array(618 'multi_match' => array(619 'query' => $args['query'],620 'fields' => $args['boost_fields'],621 'type' => 'phrase',622 'analyzer' => $analyzer,623 'boost' => 2,624 ),625 ),626 615 ), 627 616 ), … … 720 709 public static function score_query_by_recency( $query ) { 721 710 //Newer content gets weighted slightly higher 722 $date_scale = ' 720d';711 $date_scale = '360d'; 723 712 $date_offset = '180d'; 724 713 $date_decay = 0.7; … … 750 739 'field_value_factor' => array( 751 740 'field' => 'meta.active_installs.long', 752 'factor' => 0.8,741 'factor' => 2, 753 742 'modifier' => 'log2p', 754 743 ), … … 757 746 'field_value_factor' => array( 758 747 'field' => 'support_threads_resolved', 759 'factor' => 0.8,748 'factor' => 1, 760 749 'modifier' => 'log2p', 761 750 ),
Note: See TracChangeset
for help on using the changeset viewer.