The indexing service fails to run are a lot and may range from slight application configuration errors to corruption of Windows installation files in your computer. you can refer to methods below.
Solution 1: Checking Windows search service
Open services >locate Windows Search >start the service and set the startup type as Automatic.
Solution 2: Disabling Cortana
Type Cortana on the start menu >uncheck all the options there.
Solution 3: Deleting .BLF and .REGTRANS-MS files
uncheck the option Protected Operating System Files >Navigate to C:\windows\system32\config\TxR >delete all the files with the extension REGTRANS-MS and BLF.
You can also refer to the link below.