You can use these commands to reset and reinstall the Spotlight.
Step 1:Check if there are any corrupted files on Windows.
1-Right-Click on Start then click on Windows Powershell (admin)
2- Type these commands.
sfc /scannow (and press Enter)
Dism /Online /Cleanup-Image /ScanHealth (and press Enter)
Dism /Online /Cleanup-Image /CheckHealth (and press Enter)
3- The DISM tool will report whether the image is healthy, repairable, or non-repairable. If the image is repairable, you can use the /RestoreHealth argument to repair the image.
4-Type this command and press Enter:
Dism /Online /Cleanup-Image /RestoreHealth
Step 2: Reset and reinstall the Spotlight
1-Click on Start, search for Command Prompt
2-Right-click on that and select "Run as Administrator"
3-Type these commands and press Enter after each one to reset the Spotlight:
DEL /F /S /Q /A "%USERPROFILE%/AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"
DEL /F /S /Q /A "%USERPROFILE%/AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\Settings"
4-Then paste this command to reinstall the Spotlight and press Enter:
PowerShell -ExecutionPolicy Unrestricted -Command "& {$manifest = (Get-AppxPackage *ContentDeliveryManager*).InstallLocation + '\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest}"
5-When finished, reboot your PC and try to set the Spotlight again
If you receive any error message in the commands to reset the Spotlight, you can safely ignore it and proceed to the next step.
If you receive any error message running the command to reinstall the Spotlight, please take a screenshot and attach it here to help identify what is causing the problem.