28

Windows search indexer is adding most paths to repository folders (both .git and .svn) to the exclusion list.

I can remove them manually of course, but each time i rebuild the index - they are re-added.

I can add them as indexed locations, but i'd have to do that each and every time I add a new repository and I add them in varying locations depending on relation.

Why is windows excluding these and how can i alter that behavior?

seems to have something to do with enter image description here

wonder how its identifying them as repositories. As repos from C:\user\dropbox\path\to\repo are excluded automatically, where items from c:\msys64\home\user are not. If i can understand what triggers it being identified as such, i can perhaps understand the difference and how to fix the behavior.

klepp0906
  • 1,015
  • 2
  • 13
  • 20
  • Your question rambles a bit, so I did not find it to be clear. (a) the search index is not static. It changes all the time. Once built (overnight on a big system), it does not use much CPU. (b) understand your file structure and point Index Location Options to what you want indexed and not what you do not want indexed. (c) the size of the index represents what you are indexing. Large indexes are normal. My index is 170,000 items and this does not present any issue – John Apr 11 '20 at 11:47
  • Have you tried manually adding the parent directory containing the repos, or the repo directories themselves, to the search Indexer's list of directories to index (Indexing Options > Modify)? – JW0914 Apr 11 '20 at 11:56
  • 1
    If you don't need the full-text content search (just the file-name search) I would simply recommend to ignore the Windows search and use a well working tool like [**Search Everything**](https://www.voidtools.com) instead. – Robert Apr 11 '20 at 11:58
  • all decent suggestions and I do apologize for the rambling. I'm a talker - i have trouble being direct sometimes! I do in fact use everything, but try to use it only as a fallback. I'm attempting to use the search indexer in as "hands-off" a fashion as I can. the more i think about it, doing what I want is actually not likely to be plausible. I'll probably have to add those directories as directories to be indexed, or for uniformities sake find out why msys isnt hiding my .git folders at least. – klepp0906 Apr 11 '20 at 12:14
  • You asked "I'm attempting to use the search indexer in as "hands-off" " . It is completely hands off. Once properly set up, there is nothing more to do with it. I rarely look at it because it is completely automatic and not in any way CPU intensive. – John Apr 11 '20 at 12:29
  • apart from it omitting some repos and not others based on a reason i dont understand. And building a huge exclusion list. In a literal sense, you are correct though. I'm trying to understand what is causing the auto-exclusion, and best way to alter the behavior to best serve my needs. Edited the topic/question to be more concise. – klepp0906 Apr 11 '20 at 12:46
  • Try look at the tutorial below for including / excluding file extension types in Windows Search Indexing Options: https://mywindowshub.com/how-to-add-or-remove-file-types-for-search-index-in-windows-10/ – John Apr 11 '20 at 14:07
  • @klepp0906 Where did that screen shot come from? – Vimes Nov 20 '20 at 17:15
  • 1
    @Vimes about 60% the way down the page https://insider.windows.com/en-us/articles/desktop-search – klepp0906 Nov 21 '20 at 18:16
  • 2
    So this is why Windows Search has been completely worthless in opening my projects??? This is ridiculously stupid. I only found out about this while trying to disable Bing search in my search bar (I just want to search for folders on my machine...). – NobleUplift Apr 27 '22 at 23:17

3 Answers3

8

It appears to be a "feature" like your screen shot shows. I suggest using the Windows Feedback app to report the problem, or up-voting this Windows Feedback item if that link works for you (might need to use a personal Microsoft account rather than a work/school one).

Vimes
  • 470
  • 1
  • 5
  • 14
  • 1
    It says my account has no access to this feedback. – Marco Eckstein Apr 28 '21 at 20:15
  • 1
    I guess you'll have to leave a new feedback ticket. Not sure why the link failed (worked for my friend just now). – Vimes Apr 30 '21 at 15:19
  • 2
    Had a coworker try the link and they got the error. Maybe it's a corporate vs personal account issue. – Vimes Apr 30 '21 at 15:42
  • Now that you call it a "feature" I actually agree as I just realized GitHub and Bitbucket have a way to search all your code at once, so I don't actually need Windows search. Of course this isn't helpful if your repo is local only, or if your repo host doesn't have such a search feature. – Alexander Taylor Nov 28 '22 at 18:14
  • True. I usually use it to find project files I want to launch by name (`project name`+`Enter`). – Vimes Nov 29 '22 at 19:48
  • [PowerToys has a feature](https://learn.microsoft.com/en-us/windows/powertoys/run) that finds my files, so far regardless of if they're in a local git repo. – Vimes Nov 29 '22 at 19:51
4

I know this is a late answer to this, but I found a workaround. If you choose your folder (in my case, c:\code) and then go into each repo in the folder and exclude the hidden ".git" folder, the indexer seems to work.

  • 7
    Is it possible to just exclude all .git folders? Or better yet all dot folders in general? I don't understand why MS didn't do this and instead went the route of axing entire directories. – gargoylebident Apr 13 '22 at 03:04
0

On Win 10, I have found how to make the search feature work even for git repo folders. In my case, all the git initialized repo folders are in the C:\Users\USERNAME\Work\ folder. The whole User folder is checked for indexing in Indexing Options, and indexing this folder and its content automatically triggers the creation of the Excluded Folders rules for each repo in Windows Settings > Search > Searching Windows (ms-settings:cortana-windowssearch).

Workaround to be able to search:

  1. remove all thoses rules for the repos
  2. verify with regedit in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules\ that the rules for these repos have all been deleted
  3. exclude the folder C:\Users\USERNAME\Work by unchecking it (so that no further indexing is attempted, and so, preventing the creation of all those exclusion rules again)
  4. the folder still won't be indexed, but at least you can search in it (may be long though...)

I have seen a collegue with all his repos in a folder directly in C:\ (say C:\Work) an they were actually indexed! He was on Win 11, so it'd be great if someone with Win 11 could give his feedback on the subject :)

Of course I tried to replicate, but the repo was immediately excluded during indexing, as for my folder in C:\Users...

hymced
  • 145
  • 6