I have this problem as well, and have had it for quite awhile. I migrated from an M1 Mini to my current M2 Mini and I don't recall exactly when this problem appeared. Spotlight results, Mail app search, System Settings search are all non-functional, though Finder search does work.
I got frustrated with this tonight (again) so tried finding a solution (again) and came upon this thread. I was in the process of trying this:
but I did it as another local super user who is also an admin.
but noticed that as soon as I created a new account to try, my System Settings search began to respond. I tested Mail and the search was now working there as well. Weirdly, Spotlight also regained some functionality but did not return any results from `/Applications`. 🤷♂️
To further test, I deleted the newly created user and search was still working.
However, after rebooting the problem had returned. All searching was dead again.
I thought the previous experiment had perhaps revealed that the problem is some buggy behavior related to the Users system, so I returned there. This time, I tried just creating a User group. Upon doing this, I got the same result: search functionality began working correctly again. I could now search System Settings, Mail app, etc. successfully. Spotlight was still weird; I got no `/Applications` results, though it could search more places. Weirdly, for example, Spotlight could return actual mail messages, but not the Mail app itself.
I expect things to break again after rebooting, and presumably I can get a hacky fix by doing something User related (create a group, new user, etc).
I don't know if this information helps but it would seem this issue is somehow related to Users. Perhaps something went weird during the migration process?