{"record":{"id":"956a869dea9c0598","repo":"Flow-Launcher/Flow.Launcher","slug":"the-required-service-for-windows-index-search-does","errorCode":null,"errorMessage":"The required service for Windows Index Search does not appear to be running","messagePattern":"The required service for Windows Index Search does not appear to be running","errorType":"exception","errorClass":"EngineNotAvailableException","httpStatus":null,"severity":"warning","filePath":"Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs","lineNumber":106,"sourceCode":"            return WindowsIndexFilesAndFoldersSearchAsync(search, token: token);\n        }\n\n        public IAsyncEnumerable<SearchResult> ContentSearchAsync(string plainSearch, string contentSearch, CancellationToken token)\n        {\n            return WindowsIndexFileContentSearchAsync(contentSearch, token);\n        }\n\n        public IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive, CancellationToken token)\n        {\n            return WindowsIndexTopLevelFolderSearchAsync(search, path, recursive, token);\n        }\n\n        private IAsyncEnumerable<SearchResult> HandledEngineNotAvailableExceptionAsync()\n        {\n            if (!Settings.WarnWindowsSearchServiceOff)\n                return AsyncEnumerable.Empty<SearchResult>();\n\n            throw new EngineNotAvailableException(\n                \"Windows Index\",\n                Localize.plugin_explorer_windowsSearchServiceFix(),\n                Localize.plugin_explorer_windowsSearchServiceNotRunning(),\n                Constants.WindowsIndexErrorImagePath,\n                c =>\n                {\n                    Settings.WarnWindowsSearchServiceOff = false;\n\n                    // Clears the warning message so user is not mistaken that it has not worked\n                    Main.Context.API.ChangeQuery(string.Empty);\n\n                    return ValueTask.FromResult(false);\n                });\n        }\n    }\n}\n","sourceCodeStart":88,"sourceCodeEnd":123,"githubUrl":"https://github.com/Flow-Launcher/Flow.Launcher/blob/7fc63b07bbaa10a0f0b2601487913fcba9ed24b0/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs#L88-L123","documentation":"Thrown as EngineNotAvailableException when a Windows Index (OLE DB / WSearch) call surfaced a COMException and Settings.WarnWindowsSearchServiceOff is true. The exception's Action clears WarnWindowsSearchServiceOff and blanks the query, so the next search silently returns empty results instead of re-warning. The message tells the user the Windows Search service is not running.","triggerScenarios":"Calling SearchAsync/ContentSearchAsync/EnumerateAsync on WindowsIndexSearchManager when the Windows Search service (WSearch) is stopped, disabled, or its SystemIndex catalog is corrupt and CreateQueryHelper() throws a COMException. PathIsIndexed returning false would not reach this throw; the throw comes from the COM path inside QueryConstructor.CreateQueryHelper().","commonSituations":"User disabled WSearch for performance; an SSD-tweaking tool disabled the service; the SystemIndex catalog is corrupt and rebuilding; Windows feature 'Windows Search' is turned off in optional features; the service crashed and did not auto-restart.","solutions":["Start the Windows Search service: services.msc > Windows Search > Automatic, then Start.","Rebuild the index from Control Panel > Indexing Options > Advanced > Rebuild if the catalog is corrupt.","Enable the Windows Search optional feature if it was removed.","If the user intentionally does not use Windows Index, switch Settings.IndexSearchEngine to Everything or DirectEnumeration so the COM path is never hit."],"exampleFix":"// before - throw every time the service is off (until user clicks through)\nif (!Settings.WarnWindowsSearchServiceOff)\n    return AsyncEnumerable.Empty<SearchResult>();\nthrow new EngineNotAvailableException(...);\n\n// after - check the service once and remember the decision\nif (!await IsWindowsSearchRunningAsync())\n{\n    if (!Settings.WarnWindowsSearchServiceOff) return AsyncEnumerable.Empty<SearchResult>();\n    Settings.WarnWindowsSearchServiceOff = false;\n    throw new EngineNotAvailableException(...);\n}","handlingStrategy":"try-catch","validationCode":"using var sc = new System.ServiceProcess.ServiceController(\"WSearch\");\nif (sc.Status != System.ServiceProcess.ServiceControllerStatus.Running)\n    logger.Warn(\"Windows Search service (WSearch) is not running.\");","typeGuard":"static bool IsWindowsSearchRunning() { try { using var sc = new System.ServiceProcess.ServiceController(\"WSearch\"); return sc.Status == System.ServiceProcess.ServiceControllerStatus.Running; } catch { return false; } }","tryCatchPattern":"try { await manager.SearchAsync(query, token); }\ncatch (EngineNotAvailableException ex) when (ex.EngineName == \"Windows Index\") { ShowWindowsSearchOffResult(ex); }","preventionTips":["Keep the WSearch service set to Automatic.","Rebuild the index if the SystemIndex catalog is corrupt.","Switch IndexSearchEngine to Everything or DirectEnumeration if Windows Index is intentionally disabled.","Catch EngineNotAvailableException and offer to start the service."],"tags":["windows-index","wsearch","com","engine-not-available","csharp"],"backgroundTag":null,"analyzedSha":"7fc63b07bbaa10a0f0b2601487913fcba9ed24b0","analyzedAt":"2026-08-13T14:54:20.914Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}