Quick fix: Open Control Panel → Indexing Options → Modify. Untick folders you don’t need indexed — especially large folders with many small files (source code, node_modules, AppData, OneDrive). The index gets smaller, search becomes faster, and Windows Search service uses less CPU/disk.
Windows Search indexing is supposed to make file searches instant, but on PCs with 500,000+ indexed files (developers, photographers, anyone with deep folder trees), the index becomes massive and search slows down. The fix is selective indexing: keep your important folders indexed, exclude the noise.
Affects: Windows 11 (and Windows 10).
Fix time: ~15 minutes (configuration + rebuild).
What causes this
Windows Search builds an index database at C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb. Every indexed file’s metadata (name, path, modified date, contents for supported formats) is stored. The default includes Users and Start Menu, which is usually fine. But if you’ve added Documents folders from external drives, OneDrive folders, or Visual Studio source trees, the index can balloon to multiple GB.
A large index slows search because matching results requires scanning more entries. It also creates constant background indexing as files change, consuming disk I/O and CPU.
Method 1: Remove unnecessary folders from indexing
The targeted approach.
- Open Control Panel → Indexing Options. (Search Start menu for “Indexing.”)
- The dialog shows currently indexed locations and total item count. If count is >100,000, indexing is likely too broad.
- Click Modify. The Indexed Locations dialog opens.
- Look at the “Summary of selected locations” box. For each folder marked Included, decide if you actually search it:
- Don’t index: node_modules, .git, build/dist outputs, AppData, Temp, full external backup drives.
- Do index: Documents, Desktop, frequently-accessed Pictures folders, project workspace folders.
- Untick folders you don’t need. Click OK.
- Within Documents/etc., expand to exclude specific subfolders. For example: tick Users → expand → untick AppData → expand AppData and re-tick only Roaming (if you want Outlook signatures indexed).
- Click OK. Windows trims the index over the next minutes; large reductions take longer.
- For total exclusion of certain file types:
- In Indexing Options, click Advanced → File Types tab.
- Find file extensions you don’t need indexed (e.g., .log, .tmp, .bak). Untick them.
This is the right approach for selective indexing — keeping search useful while reducing index bloat.
Method 2: Rebuild the index after major changes
After excluding many folders, force a rebuild to compact the database.
- Open Indexing Options → Advanced.
- Click Rebuild. Confirm.
- Windows deletes the existing index and starts over. Rebuild takes 1–4 hours depending on indexed file count and disk speed.
- During rebuild: search may return incomplete results. Wait for “Indexing complete” at the top of Indexing Options.
- After rebuild, check the file size of
C:\ProgramData\Microsoft\Search\Data\Applications\Windows\Windows.edb— should be smaller than before. - For PCs where rebuild gets stuck partway: stop the Windows Search service (services.msc → Windows Search → Stop), delete the entire
Data\Applications\Windowsfolder contents, then start the service. The index rebuilds from scratch. - For OneDrive folders: don’t index files marked as cloud-only. Indexing forces downloads. Either keep all OneDrive files on this device, or exclude OneDrive from indexing entirely.
Rebuild reclaims space and improves search responsiveness post-changes.
Method 3: Disable Windows Search entirely if you don’t use it
For users who use third-party search (Everything, Listary) and don’t need Windows Search.
- Press
Win + R, typeservices.msc, press Enter. - Find Windows Search. Right-click → Properties.
- Set Startup type to Disabled. Click Stop. Apply.
- The Windows Search service stops. The index database remains but isn’t updated.
- To free the index database space: delete
C:\ProgramData\Microsoft\Search\Data\Applications\Windows\. Saves 1–5 GB. - Install Everything from voidtools.com (free). It scans NTFS Master File Table directly for instant filename search (no indexing latency).
- For Start menu search to keep working: leave Search service Manual instead of Disabled. Start menu uses an in-memory mini-index that doesn’t require full Search service running.
- To re-enable later: set Startup type back to Automatic, click Start.
This is the right path for power users who prefer Everything’s instant filename search to Windows Search’s indexed full-text.
How to verify the fix worked
- Open Indexing Options. Total item count should be reduced (target: under 100,000 for typical office use).
- Check Windows Search service’s CPU/disk usage in Task Manager — should drop significantly when not actively indexing.
- Open File Explorer in an indexed folder. Search for a known file name — result appears within 1 second.
If none of these work
If indexing is still slow after trimming, the index may be corrupted. Run the troubleshooter: Settings → System → Troubleshoot → Other troubleshooters → Search and Indexing → Run. Fixes common issues automatically. For huge folder trees (>500,000 files) like dev workspaces with many node_modules: Windows Search will struggle regardless of settings. Use Everything or Listary for those folders, keep Windows Search for Documents only. For OneDrive heavy users: exclude OneDrive from indexing entirely. OneDrive maintains its own search index in the cloud accessible via the OneDrive website — you don’t need local indexing of cloud files. For PCs with HDD storage (not SSD): indexing is fundamentally slow because random reads cost ~10ms each. Either upgrade to SSD or accept slower search. Indexing 100,000 small files on HDD can take 8+ hours. For old indexes that won’t shrink: rebuild is required. The .edb database doesn’t shrink when you exclude folders — it just marks entries as deleted. Full rebuild is the only way to reclaim space.
Bottom line: Control Panel → Indexing Options → Modify. Exclude folders you don’t search (AppData, build outputs, node_modules). For drastic improvements, rebuild the index after exclusion.