Download and unzip the batch file at
https://www.majorgeeks.com/files/details/reset_and_repair_windows_spotlight_in_windows_10.html
It says Windows 10 but is also applicable to Windows 11.
Then follow steps two and three in the instructions on that page.