WebStorm: search does not work

SearchIntellij IdeaPhpstormWebstorm

Search Problem Overview


I know that is used to search : Ctrl+Shift+F or Edit | Find | Find in Path and it worked before, but now always returns the empty set, although I know that what I'm looking for - there is in the project

Maybe someone had this problem?

Search Solutions


Solution 1 - Search

As lena said, the following should fix it for you:

  1. Click File -> Invalidate Caches / Restart..
  2. Click the button "Invalidate and Restart"
  3. After restart, try run the search again

Solution 2 - Search

For me nbaosullivan's proposed solution didn't work.

In my case Recursive(Alt+Y) options wasn't selected. I selected it and it worked and it will be set as default, you don't need to select it all the time.

See that icon and select it please

Solution 3 - Search

Try this (it helped me in PhpStorm 2019.3.1 when "Invalidate Caches / Restart" did not):

  1. Close WebStorm

  2. Backup directory <your project>/.idea/ to anywhere

  3. Delete file <your project>/.idea/modules.xml

  4. Open WebStorm

Solution 4 - Search

Newer version of Webstorm /PHPStorm automatically exclude some folders. For example vendor folder.

https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000798990-Vendor-directory-being-automatically-excluded

make sure that folders are not excluded

Solution 5 - Search

I thought I had this issue but I think actually WebStorm is only returning the first 100 or so results which all happen to be located in 2 files and thus the other occurrences in other files are not shown.

Solution 6 - Search

For me unchecking the "Words" option (which searches as a whole word) make it work.

Solution 7 - Search

As an alternative where I needed to refactor the word "holder" with "owner". Using Webstorm's find did not work very well for me. I decided to use instead the the command line with egrep:

egrep -Rli [^place]holder ./src
-R (recursive all files in directory including symbolic links)
-l (file name only)
-i (ignore case)

I found everything and excluded some instances as well via regex. It is way easier and most accurate.

Solution 8 - Search

This is how I fixed the issue:

  1. File
  2. Repair IDE...
  3. (Follow steps to repair indexes)

After doing this, I was able to search "everywhere" using Shift Shift

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLolaView Question on Stackoverflow
Solution 1 - SearchnbaosullivanView Answer on Stackoverflow
Solution 2 - SearchShahzaib Hayat KhanView Answer on Stackoverflow
Solution 3 - SearchMihail H.View Answer on Stackoverflow
Solution 4 - SearchzainengineerView Answer on Stackoverflow
Solution 5 - Searchdanday74View Answer on Stackoverflow
Solution 6 - SearchalpereView Answer on Stackoverflow
Solution 7 - SearchRudyDView Answer on Stackoverflow
Solution 8 - SearchKellen StuartView Answer on Stackoverflow