Duplicate CLI rebuild search index

duderuud

Well-known member
It seems it is not possible to rebuild the ES index with the cmd.php tool.

Would be really handy because I could run it in a screen. Our current (old) index is 8.5GB so rebuilding in the browser is a bit of a pain...
 
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
Not really specific to ES as the system is search handler agnostic, so have moved to XF suggestions for consideration in the future.
 
Correct me if I'm wrong but starting a rebuild and close the browser also kills that process right?
For that it would be a really nice feature to be able to rebuild in the cli!

Just to be sure, no way to do this with the xf-dev:rebuild-caches option?
 
Yeah I'm very sure. We don't have a feature that allows you to rebuild the search index (or any other rebuild) from the CLI. That particular command is actually something completely different though I appreciate it has a similar name.

Starting a rebuild and closing the browser pauses the process, so just try not to close the browser. If you happen to close the browser then it should resume where it left off. In XF1 (and soon XF2, something we missed) there will be a message on the Admin CP home page that says: "There are manual rebuild processes that have been stopped before completion. Click here to complete them." which allows you to continue where you left off.
 
Thanks for the info. Problem is, on my testserver with 27mln posts it takes a LONG to rebuild. Sucks to have my pc/laptop on the whole time (and making sure it doesn't go into sleep).

A cli option would be deeply appreciated :)
 
What is a "long time" though? For one of my busiest forums, which now has 16 million posts, I reindexed a couple of million posts ago and it only took a couple of hours at the most. (I'm actually thinking it might have been an hour and a half.) That is not a long time at all. Not compared to vBulletin--a former admin of one of my forums had a data breach and had to rebuild the index after restoring the data. It ran for well over a day, for far fewer posts (maybe less than a million). We've got it easy now. ;)

Although I could put in one suggestion for command-line rebuilding (of anything, not just the search engine: it could be done via a cron job on the server. It's usually not necessary, but could be useful to tidy things up maybe once per month.
 
I believe it took about 6 hours for 27mln posts.

But that all depends on your hardware. I ran it on a VM host with 10k disks. I guess a modern dedicated box with ssd's will do it in half that time.
 
Top Bottom