[wp-trac] [WordPress Trac] #17152: Multiple keyword search: unnecessary sentence search

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 17 08:05:46 UTC 2011


#17152: Multiple keyword search: unnecessary sentence search
--------------------------+-----------------
 Reporter:  scribu        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  3.2
Component:  Performance   |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------
 's=foo+bar' generates this query:

 {{{
 SELECT SQL_CALC_FOUND_ROWS wp_posts . *
 FROM wp_posts
 WHERE 1 =1
 AND (
         ((wp_posts.post_title LIKE '%foo%') OR (wp_posts.post_content LIKE
 '%foo%'))
         AND
         ((wp_posts.post_title LIKE '%bar%') OR (wp_posts.post_content LIKE
 '%bar%'))
         OR
         (wp_posts.post_title LIKE '%foo bar%')
         OR
         (wp_posts.post_content LIKE '%foo bar%')
 )
 AND wp_posts.post_type IN ('post', 'page', 'attachment')
 AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')
 ORDER BY wp_posts.post_date DESC
 LIMIT 0 , 10
 }}}

 Unless I'm missing something, this part is superfluous:

 {{{
         OR
         (wp_posts.post_title LIKE '%foo bar%')
         OR
         (wp_posts.post_content LIKE '%foo bar%')
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17152>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list