Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide queries to run in case of failed Recreate Index #47

Closed
ajaydsouza opened this issue Feb 21, 2016 · 7 comments
Closed

Provide queries to run in case of failed Recreate Index #47

ajaydsouza opened this issue Feb 21, 2016 · 7 comments
Milestone

Comments

@ajaydsouza
Copy link
Contributor

Recreate Index fails when a blog has too many posts due to PHP time outs. Provide a user with a list of copy-pasteable queries they can run in phpMyAdmin or Adminer

Optionally prompt to install Adminer WordPress plugin.

@ajaydsouza ajaydsouza added this to the 2.3 milestone Feb 21, 2016
@jonathanenbe
Copy link

Hi,

Is this available yet? Or what should I do when it fails to build the index? Having a lot of posts and I get 504 timeout

Thank you

@ajaydsouza
Copy link
Contributor Author

This isn't available yet. I'll have it in the next version.

You need to run these queries in phpMyAdmin

ALTER TABLE wp_posts DROP INDEX crp_related;
ALTER TABLE wp_posts DROP INDEX crp_related_title;
ALTER TABLE wp_posts DROP INDEX crp_related_content;
ALTER TABLE wp_posts ADD FULLTEXT crp_related (post_title, post_content);
ALTER TABLE wp_posts ADD FULLTEXT crp_related_title (post_title);
ALTER TABLE wp_posts ADD FULLTEXT crp_related_content (post_content);

@jonathanenbe
Copy link

Thank you. I found out that it builds the index after all. It happens this way, I activate the plugin once it times out, I activate the plugin second time it times out again (this all depends on how many posts there are), I activate the plugin 3rd time and it's getting activated then I get the indexes notice and I hit rebuild the index, the index rebuild is done and I don't get the file indexes notice anymore so I assume the index has been built. I open some posts and see the related posts working perfectly so that makes me believe the index is built. I will just run the db queries just to be sure.

By the way how you've been able to make it work with so many posts? Because as you know all the other plugins are glogging when there's many posts involved. The relevancy is absolutely great and the way it works with so many posts it's crazy, so good that I can't believe to be honest.

Many thanks for this plugin

@ajaydsouza
Copy link
Contributor Author

It uses mySQL's inbuilt index to do the trick. That's the big part.

The issue I have with this is like you said above regarding time out on activation which is the irritating part, to be honest, in this plugin. My plan is to create a new table in a future version which will be blank on initialisation and then run some cron jobs in the background to pull in the posts in phases. That's the theory. I'm still unsure how to do it in practice!

@jonathanenbe
Copy link

Do you have any idea how can I run those queries without getting 2013 Mysql error connection lost? Tried all suggestions but still getting that error when manually trying to build the index.

Thank you

@ajaydsouza
Copy link
Contributor Author

Are you running this in phpMyAdmin? Found this suggestion in the mySQL docs: https://dev.mysql.com/doc/refman/5.6/en/error-lost-connection.html

@ajaydsouza
Copy link
Contributor Author

Queries added in: df128c8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants