Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #633 from algolia/perf-indexing
Browse files Browse the repository at this point in the history
Perf indexing
  • Loading branch information
rayrutjes authored Jul 17, 2017
2 parents 8749298 + 519bf73 commit 913996b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions includes/indices/class-algolia-searchable-posts-index.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,12 @@ public function get_id() {
*/
protected function get_re_index_items_count() {
$query = new WP_Query( array(
'post_type' => $this->post_types,
'post_status' => 'any', // Let the `should_index` take care of the filtering.
'suppress_filters' => true,
'post_type' => $this->post_types,
'post_status' => 'any', // Let the `should_index` take care of the filtering.
'suppress_filters' => true,
'cache_results' => false,
'lazy_load_term_meta' => false,
'update_post_term_cache' => false
) );

return (int) $query->found_posts;
Expand All @@ -315,13 +318,16 @@ protected function get_re_index_items_count() {
*/
protected function get_items( $page, $batch_size ) {
$query = new WP_Query( array(
'post_type' => $this->post_types,
'posts_per_page' => $batch_size,
'post_status' => 'any',
'order' => 'ASC',
'orderby' => 'ID',
'paged' => $page,
'suppress_filters' => true,
'post_type' => $this->post_types,
'posts_per_page' => $batch_size,
'post_status' => 'any',
'order' => 'ASC',
'orderby' => 'ID',
'paged' => $page,
'suppress_filters' => true,
'cache_results' => false,
'lazy_load_term_meta' => false,
'update_post_term_cache' => false
) );

return $query->posts;
Expand Down

0 comments on commit 913996b

Please sign in to comment.