Search Indexing is interfering with our build process, and I would like to exclude all instances of our dev directories from the indexer (we have a trunk and branches setup).
I could exclude the whole parent directory, but that would exclude too many files.
I can do it manually by deselecting each instance in the indexing options, but this is very manual and tedious.
I've found the rules in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules
, but I don't know if it's kosher to update that on the fly.
Is it possible to exclude directories from Windows Search by wildcard or some other less-manual criteria?
Best Answer
I looked in the
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\DefaultRules
key and found something interesting.DefaultRules\1
contains:Look at that
URL
key - two wildcards!So since Windows Search natively supports wildcards, all we have to do is tweak an existing exception.
Adding wildcard exceptions to Windows Search
Add an exception for a suitable directory by going to
Indexing Options
→Modify
and deselecting one directory (in my case,C:\Users\MyName\dev\trunk\bin
).Go to
Services
, selectWindows Search
, right-click on it, and selectStop
.Open Registry Editor and navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules
.Look through each numbered subkey to find yours.
Tweak the exception.
In my case, I have multiple branches checked out, so I will have directories for
trunk
and for each versioned branch (such as 3.2, 4.0, etc). So I changed theURL
key fromto
Right-click on
Windows Search
and selectStart
orRestart
.That's it! The directories are even unchecked/excluded in the Indexing Options.