Help to speed up wordpress search query for site with 700k posts
-
Hello, Im having issues with my wordpress site, it is a newspaper site (Jannah theme) with over 25K request per day, total post content is about 700k records.
We are using cloudflare which I think does a decent Job managing the cache and keeping out the bad bots, have an problem with the FB bots but that’s another issue.
The main problem that currently have are the search request, múltiple search request over a few seconds increase the server load momentarily, sometimes combined with high traffic causes the sever to stop responding, until the load backs to normal. I already create a fulltext index for post, excerpts and titles, which helped but is not good enough (search passed from 15-20 s. to 4-5 s.)
The slow query log shows that those search queries are taking a long time, 4,5,10 s. Seems that the % (wildcard clause) at the begining of the search query is not necessary and also if I could limit the query to lets say (100 records) instead of delivering all the results could also help. I’ve tried to look for this over the internet which no luck, also trying finding a plugin, there are a few but they don’t do what do what I’m looking for. Any of you know a plugin or know how to modify the search query of the functions.php to at least include the LIMIT clause in the search post query?I’ve tried also plugins like relevanssi, which creates an alternate index table, the problem that the result table was over 10 Gb. I was in the middle of other issues and I had to delete it, I was trying with another similar plugin but the indexing is slow and also demands a lot from the server.
I thought splitting the post in two, the recent ones in one table and the old ones in another table or even another database. So I could search first among 60k posts and then if I need more results search in the rest. But the same, no luck finding a plugin or solution. Any one has this issues/problems?
Thanks for any help or suggestions
- The topic ‘Help to speed up wordpress search query for site with 700k posts’ is closed to new replies.