The steps found at the following URL offer a detailed set of instructions (with illustrations) on how to do this: /tutorials/82156-reset-re-register-windows-spotlight-windows-10-a.html.
However, if that doesn't work, then you will need to reset Windows Spotlight to fix this issue. So that would be a first step towards resolution.
Typically, rebooting the machine at this point clears the error and returns things to normal, since this frees up any memory (RAM) bound to the stalled task.