Changeset 10117 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/libs/site-search/jetpack-search.php
- Timestamp:
- 08/05/2020 01:49:48 AM (5 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
r10115 r10117 430 430 } 431 431 432 // Block Search. 433 if ( !empty( $query->query['block_search'] ) ) { 434 $es_wp_query_args['block_search'] = $query->query['block_search']; 435 436 // Limit to the Block Tax. 437 $es_wp_query_args['filters'][] = array( 438 'term' => array( 439 'taxonomy.plugin_section.name' => array( 440 'value' => 'block' 441 ) 442 ) 443 ); 444 } 445 432 446 $es_wp_query_args['locale'] = $query->get( 'locale' ) ?: get_locale(); 433 447 … … 763 777 } 764 778 779 $is_block_search = ! empty( $args['block_search'] ); 780 765 781 if ( $args['locale'] && $args['locale'] !== 'en' && substr( $args['locale'], 0, 3 ) !== 'en_' ) { 766 782 $locale = $args['locale']; … … 788 804 'taxonomy.plugin_tags.name', 789 805 ); 806 if ( $is_block_search ) { 807 $boost_phrase_fields[] = 'block_title_' . $locale; 808 $boost_phrase_fields[] = 'block_title_en^' . $en_boost; 809 } 790 810 $boost_ngram_fields = array( 791 811 'title_' . $locale . '.ngram', … … 797 817 'slug_text', 798 818 ); 819 if ( $is_block_search ) { 820 $boost_title_fields[] = 'block_title_' . $locale; 821 $boost_title_fields[] = 'block_title_en^' . $en_boost; 822 $boost_title_fields[] = 'block_name'; 823 } 799 824 $boost_content_fields = array( 800 825 'excerpt_' . $locale, … … 814 839 'taxonomy.plugin_tags.name', 815 840 ); 841 if ( $is_block_search ) { 842 $boost_phrase_fields[] = 'block_title_en'; 843 } 816 844 $boost_ngram_fields = array( 817 845 'title_en.ngram', … … 821 849 'slug_text', 822 850 ); 851 if ( $is_block_search ) { 852 $boost_title_fields[] = 'block_title_en'; 853 $boost_title_fields[] = 'block_name'; 854 } 823 855 $boost_content_fields = array( 824 856 'excerpt_en',
Note: See TracChangeset
for help on using the changeset viewer.