Title: Action on result posts array
Last modified: August 22, 2016

---

# Action on result posts array

 *  [PoraTuK](https://wordpress.org/support/users/poratuk/)
 * (@poratuk)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/action-on-result-posts-array/)
 * Hello.
    I use your plugin and it was fine. But I had an “problemki” that will
   probably be useful for many users. With action I changed the display and data
   are recorded in Elasticsearch. And when I needed the data to WP I have to go 
   back to them in the database (with 33 queries against 109). Here’s an alternative:
   a file /elasticpress/classes/class-ep-wp-query-integration.php line: 278 – 282
   $this->posts_by_query[spl_object_hash( $query )] = $new_posts;
 *  do_action( ‘ep_wp_query_search’, $new_posts, $search, $query );
    Change to $
   new_posts = add_filter( ‘ep_wp_query_search’, $new_posts, $search, $query );
 *  $this->posts_by_query[spl_object_hash( $query )] = $new_posts;
 * So this change can save some time on the script (in my case it is 2 seconds)
 * [https://wordpress.org/plugins/elasticpress/](https://wordpress.org/plugins/elasticpress/)

The topic ‘Action on result posts array’ is closed to new replies.

 * ![](https://ps.w.org/elasticpress/assets/icon-256x256.jpg?rev=2458479)
 * [ElasticPress](https://wordpress.org/plugins/elasticpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elasticpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elasticpress/)
 * [Active Topics](https://wordpress.org/support/plugin/elasticpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elasticpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elasticpress/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [PoraTuK](https://wordpress.org/support/users/poratuk/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/action-on-result-posts-array/)
 * Status: not resolved