The search feature is working again. It took about 40 hours, most of which was spent creating a new caching mechanism for repetitive searches, and re-indexing all the products’ names and descriptions.
I didn’t change the algorithm; the results are pretty much the same as before. But now it’s stable, scalable, and much much faster.
Thanks for your patience.