Making WordPress.org


Ignore:
Timestamp:
03/10/2015 10:00:55 PM (11 years ago)
Author:
iandunn
Message:

WordPress.tv: Disable expensive search sort to avoid 504 errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.tv/public_html/wp-content/themes/wptv2/functions.php

    r1044 r1390  
    214214
    215215        /**
     216         * Sort the search results by the number of views each post has
     217         *
    216218         * @param WP_Query $query
    217219         */
    218220        function search_pre_get_posts( $query ) {
     221                /*
     222                 * @todo Optimize this before re-enabling
     223                 *
     224                 * This method was disabled because it caused 504 errors on large result sets
     225                 * (e.g., http://wordpress.tv/?s=keynote). Sorting by a meta value is not performant.
     226                 *
     227                 * Maybe look at ways to do the sorting in PHP, or just use Elasticsearch instead.
     228                 */
     229                return;
     230
    219231                if ( ! $query->is_main_query() || ! $query->is_search ) {
    220232                        return;
Note: See TracChangeset for help on using the changeset viewer.