Making WordPress.org


Ignore:
Timestamp:
11/28/2016 01:29:30 AM (10 years ago)
Author:
tellyworth
Message:

Plugin directory: add debug bar panel for search.

File:
1 edited

Legend:

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

    r4334 r4434  
    5757        protected $found_posts = 0;
    5858
     59        protected $search_query;
    5960        protected $search_result;
    6061
    … …  
    134135
    135136                add_filter( 'jetpack_search_es_wp_query_args', array( $this, 'filter__add_date_filter_to_query' ), 10, 2 );
     137
     138                // Debug
     139                if ( file_exists( __DIR__ . '/jetpack-search-debug.php' ) )
     140                        include_once( __DIR__ . '/jetpack-search-debug.php' );
    136141        }
    137142
    … …  
    296301                //Only trust ES to give us IDs, not the content since it is a mirror
    297302                $es_query_args['fields'] = array(
     303                        'slug',
     304                        'support_threads_resolved',
     305                        'support_threads_percentage',
     306                        'support_resolution_yes',
     307                        'support_resolution_no',
     308                        'support_resolution_percentage',
     309                        'active_installs',
     310                        'contributors_active_installs',
     311                        'tested',
     312                        'meta.rating.double',
    298313                        'post_id',
    299314                        'blog_id'
    … …  
    302317                // This filter is harder to use if you're unfamiliar with ES but it allows complete control over the query
    303318                $es_query_args = apply_filters( 'jetpack_search_es_query_args', $es_query_args, $query );
     319                $this->search_query = $es_query_args;
    304320
    305321                // Do the actual search query!
    … …  
    423439        }
    424440
     441        public function get_search_query() {
     442                return $this->search_query;
     443        }
    425444
    426445        /////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.