Search not showing all results...
Answered
I am using the Find in Path tool, but when I search for 'svg', for example, there are results that do not appear in the results of a search using '> svg'. Is there a limit to the number of results displayed?
Please sign in to leave a comment.
Please try File | Invalidate Caches | Invalidate and Restart.
Serge - can you explain more why this happens and how I can prevent having to invalidate the cache in the future? I just broke one of our builds because I expected search to find all occurrences of a string.
Caches can become corrupted if IDE is not shut down properly or your PC loses power/BSODs, etc.
is there a way that intellij could detect when it is not properly shut down and to clear the cache on it's own?
Yes, there is logic to do that, but in some cases it can not detect the caches corruption automatically.
this makes intellij feel broken to me in a pretty scary way. do you have tasks to track that in a way that people can follow along with?
Feel free to report one with the logs directory attached when the caches become invalid and are not invalidated automatically so that the search doesn't work properly.
Intellij is one of the buggiest software i have installed on my PC. I'd recommend staying away from it, there is plenty scary/shitty errors like this(ie displaying contents of different file from hard drive when opening file from project), you really can't rely on it on Windows it's a piece of garbage
Also experienced the same issue multiple times - not knowing when the search will fail me is dangerous for some changes
@Ronald Findling please report at https://youtrack.jetbrains.com/issues/IDEA with Help | Collect Logs and Diagnostic Data .zip file attached and description of your steps with the expected/actual result. Thank you.
I have found out that Find in Path tool produces more accurate results when 'Match case' option is enabled, so I always make sure to keep it enabled.
I also have this problem and already broke my project several times when replacing terms.
I invalidated the caches and it does NOT help! Funniest thing is that every search for the SAME term gives me different results, different files, different ordering of the files, different number of files. Looks pretty random.
This problem seems to exist for 3 years. When do you fix this?
You likely have a new issue specific to 2021.1 update, please try the hotfix here: https://youtrack.jetbrains.com/issue/IDEA-266391.
Thank you very much, this seems to help! How often I have to do this, or is it now fixed permanently?
You can find the links to the builds with the permanent fix in the linked ticket. Release with the fix will be also available soon.
I'm using 2022.1 & just experienced this issue: broke our code because I did a global search, and it did not properly return all the results. Manually invalidating caches did fix it, but this *really* should not be necessary - to have an IDE break your product because it fails to complete a simple text search really isn't a great look.
JK Please use the current build: https://www.jetbrains.com/idea/download/index.html (2023.1.4 at this moment).
Still happens randomly with the current build 2023.1.4.
Hello Lukas,
Could you please provide examples for investigation?
Still happening to me too but I have no idea why. Given I have a UPS my PC is not unexpectedly restarting.
I'll try to find some examples in the future but its hard to do given I don't even know when the failures occur (only see the problems it creates afterwards).
I like IntelliJ for personal projects but I feel like it's not ready for commercial use with problems like this. I'd suggest not relying on a cache which has proven unreliable. At least give us an option to do a search on the actual files instead of only against the cache.
It broke again on my second search after invalidating the cache so I filed a bug: Missing search results using "Find in Files" : IDEA-329950 (jetbrains.com)
This is still happening in 2023.1.4. It just took me several hours to figure out how a particular change could've possibly broke our build, and it turned out it's because Webstorm did not search properly. This has been ongoing for 6 years now, seems like something as basic as search really should be able to be relied upon…
Addendum: it looks like the search dialog says “107+ matches in 25+ files”. I'm not sure if the “+” is intended to mean that it's knowingly omitting some results, but in either case, having the dialog show incomplete results (knowingly or not) is obviously an issue.
Addendum 2: even after invalidating the cache, I cannot get it to find all results. I'm having to use VS Code just to do a proper find-replace.
Justin, please see https://youtrack.jetbrains.com/issue/IDEA-196723/Find-in-path-window-does-not-list-all-instances-of-the-searched-word and the linked issues.
I see. So I guess showing incomplete results is the intended behavior for the Ctrl+Shift+F popup (which will probably always be the first encounter of trying to “global search”), & it's just super unintuitive/unclear UI that you actually need to do a secondary search to have it be complete.
Edit: once we “complete” the search in the secondary UI ("Find Window"), I see that the Replace button is there, but where can we see / how can we edit the replace text? i.e. the popup has both the “find” and “replace” textboxes available at the top. I don't see the same in this new window, such that I can customize each replacement as I go through the results.
The same issue with incomplete search results for me and my colleague.
Invalidate caches doesn't help.
Open the results in Find Window and see if it helps. Search dialog doesn't show all the results if you see the “ + ” sign in the numbers.