If building the index times out, do not clear the index. Instead just click “Continue indexing”. Relevanssi will continue where the indexing timed out.
If you clear index at that point, you’ll just lose work that is already done and need to do it twice.
I’m not implying we should clear the index if it fails due to server time out. I’m implying if mass changes were made to the posts or anything else that would affect Relevanssi results and we needed to re-index all of the content, there’s no way to clear the index and re-index everything without manually deleting the rows in the database. That’s where a “Clear Index” button would be convenient.
P.S. You should consider implementing a simple Javascript queuing system that can kick off multiple indexing requests one after another rather than making user babysit the “Continue Indexing” button.
Yes there is: click the “Build index” button. That’s the way you should do it. Click “Build index”, then if it fails, click “Continue indexing”. There’s no need for a third button, when the two current buttons do exactly what is necessary. There’s no need to mess directly with the database.
Re your P.S., yes, that would be great. Too bad my JavaScript skills falls short. I should probably hire someone do that.