WordPress.org

Making WordPress.org

Changeset 6590


Ignore:
Timestamp:
02/10/2018 10:13:38 AM (4 years ago)
Author:
ocean90
Message:

Plugins Directory: Adjust pagination handling for search results to match updated Elasticsearch limits.

See https://developer.wordpress.com/docs/elasticsearch/elasticsearch-queries/.
Fixes #3442.

File:
1 edited

Legend:

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

    r6287 r6590  
    375375        }
    376376
    377         // ES API does not allow fetching past the 10,000th post
    378         $page = min( $page, floor( 9999 / $posts_per_page ) );
     377        // ES API does not allow fetching past the 9,000th post
     378        $page = min( $page, floor( 9000 / $posts_per_page ) );
    379379
    380380        $date_cutoff    = strftime( '%Y-%m-%d', strtotime( '-8 years' ) );
     
    444444
    445445        // Total number of results for paging purposes
    446         $this->found_posts = min( $this->search_result['results']['total'], 9999 ); // The Jetpack search API errors out if we try to request past 10k
     446        $this->found_posts = min( $this->search_result['results']['total'], 9000 ); // The Jetpack search API errors out if we try to request past 9k
    447447
    448448        // Don't select anything, posts are inflated by Jetpack_SearchResult_Posts_Iterator
Note: See TracChangeset for help on using the changeset viewer.