[wp-trac] [WordPress Trac] #10667: Integration of Search API into core

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 23 22:17:30 UTC 2009


#10667: Integration of Search API into core
----------------------------+-----------------------------------------------
 Reporter:  jshreve         |       Owner:             
     Type:  task (blessed)  |      Status:  new        
 Priority:  normal          |   Milestone:  2.9        
Component:  General         |     Version:  2.9        
 Severity:  normal          |    Keywords:  needs-patch
----------------------------+-----------------------------------------------

Comment(by andy):

 Excellent first draft!

 What happens in WP_Query::get_posts when is_search? It looks like it will
 waste a database query and ignore the incorrect results. There are also
 some problems with execution order. Populating $wp_query->posts during
 template_redirect will expose any number of plugins to the incorrect
 results from above.

 I think the search query should actually happen during
 WP_Query::get_posts, populate the appropriate object vars, run the
 appropriate filters on the result set, and skip everything else in that
 method. If possible, run the usual filters (for caching, etc.) on the
 query parts and then let the query happen as usual.

 I expect some search plugins will return nothing more than an array of
 post_id's. The posts query would then look like SELECT * FROM $wpdb->posts
 WHERE ID IN(78,8,26).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10667#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list