Disable regexp in search.
-
Hey,
I hope this is the right forum for my topic.I am straggling for couple of days with the search engine.
I am not using any plugin for search.
In my site, there are more than 20,000 posts, and when im looking for a keyword with too many results the mysql is crashing or the http session is timed out.For example, I searched for ‘q’. and it took between 40 seconds of querying to 10 or even disconnection (depends on how the server is handling at the moment.)
but when I manually queried without the REGEXP, I got same results in 1-2 seconds.Can you please guide me where the bold part is implemented so i can remove it from there?
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE ‘%q%’) OR (wp_posts.post_content LIKE ‘%q%’) OR (wp_posts.post_content REGEXP ‘\\[table id=([“\’]?)(3|6|7|8|9|10|11|13|15)([\]”\’ /])‘))) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’, ‘flagallery’, ‘discussion’) AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_author = 2882 AND wp_posts.post_status = ‘private’) ORDER BY wp_posts.post_title LIKE ‘%q%’ DESC, wp_posts.post_date DESC
Thank you
- The topic ‘Disable regexp in search.’ is closed to new replies.