Mac El Capitan Spotlight XPC Connection Invalidated
Based on your question and the subsequent conversation where you provided the SMART Status of your internal drive, your hard drive is failing and causing the issue you are experiencing.

You need to replace your hard drive.  The good news is that it is not very expensive.

Your Macbook which identified by DriveDX as a MacBookPro9,2 (Mid 2012) uses a standard SATA drive and you can upgrade to an SSD and increase your performance dramatically pretty inexpensively (at the time of this, they are trending about $150 USD).  I have used Samsung drives with great success.  Changing it out only requires removing 10 phillips screws.

I have more info on how to do this on this post:  My Mac is getting really slow, what should I do?

IMO, I would keep this running for a few more year because Apple has now made it impossible to upgrade your RAM or HDD meaning you must configure it with what you hope you are going to need in the future.