In my project I have .deploy folder which is created/updated when I deploy my app locally. Is it possible to disable indexing on that folder? Everything slows down whenever I deploy and it's really annoying - I have to wait a few minutes whilist intellij doing unnecessary indexing. In module view I excluded that folder but it's not helping.
-
One more solution is to ignore folders/files. http://stackoverflow.com/a/30686306/4899609 – Aliaksei Yatsau Jun 06 '15 at 18:57
-
real pain if you are using git worktree – 10101010 Feb 13 '18 at 19:21
6 Answers
Mark this folder as Excluded in the File | Project Structure | Modules | Sources
tab.
Edit: also make sure it's not added as a library in the project.

- 389,263
- 172
- 990
- 904
-
9
-
4Do you use 10.5.1? Make sure this directory is not added as a library anywhere in your project. – CrazyCoder Jul 01 '11 at 13:03
-
Don't know why intellij picked it up as a library folder but you're right - it was added as a library. Cheers – Marcin Szymaniuk Jul 01 '11 at 17:56
-
19This also excludes the file from a lot of other things. I don't want to exclude the file from the project - just the index. I still want the file to appear in the list of changed files so i can commit the file (or view diffs or whatever) – B T Mar 04 '15 at 19:15
-
1Agee with @BT, this is a poor solution since it exclude from the artifacts built by IntelliJ. – Chico Sokol Aug 18 '15 at 23:27
-
How can I ignore a single file? I have a PyCharm project that creates a large `.c` file from `.pyx` and PyCharm tries to index it that takes for ever. It is not in a separate directory to ignore – dashesy Sep 26 '18 at 22:59
-
2
-
@CrazyCoder that is a .c file, so I should map all .c files to a text file? this is the only generated c file (thus huge and not worth indexing), but thanks for the suggestion that will be useful. – dashesy Sep 28 '18 at 00:02
-
1This wasn't working for me even after multiple "invalidate cache and restart" and even an upgrade from 2019.1 to 2019.2. What worked was right clicking on the folders that were excluded and unselecting excluded and re-excluding them. It even was able to work mid-indexing, real time, when I saw folders that should not be indexed being indexed, I just toggled the exclusion and it stopped indexing them right then and there, as expected. – Elijah Lynn Aug 19 '19 at 18:48
-
-
@dashesy please submit a ticket at https://intellij-support.jetbrains.com/hc/requests/new with [idea.log](https://intellij-support.jetbrains.com/hc/articles/207241085) attached. – CrazyCoder Oct 02 '19 at 01:52
-
@CrazyCode I just did and attached the thread dumps. I have marked some symlinks to cifs-mounted directories as ignored, but apparently PyCharm still hangs on those directories. Specially when I open 2 projects in 2 windows PyCharm hangs trying to look into those (that it should not) – dashesy Oct 02 '19 at 22:28
-
2Can you do that with a settings file in the root directory rather than this setting ending up in the .idea directory? – R. van Twisk Feb 18 '21 at 16:09
On IntelliJ 13+ (don't know for earlier versions), you can right click on a folder > Mark Directory As > Excluded.

- 35,493
- 19
- 190
- 259

- 1,819
- 1
- 13
- 6
-
This. Thanks. So much easier than trying to figure out a regex under the exclude dialogue haha. +1 – dudewad Jan 26 '15 at 19:48
-
3
-
-
1Right click on the concerned folder in "project" and next go to "Mark folder as". The other way is go to "settings" and type "directories" into the search field. – MathKimRobin Feb 05 '16 at 12:56
-
4
-
-
2Does this exclude the folder from anything other than the search indexer? It won't exclude it from builds, deployment, etc. right? – Janac Meena Jul 08 '19 at 14:59
if you cannot do it throu the Modules menu because your intellij freezes (like in my case) edit .iml file of your projet and add excludeFolder line as below:
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/features" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>

- 5,793
- 1
- 33
- 45

- 672
- 7
- 21
-
Thanks - was having this issue and this really helped. Added this to each module's iml file. Worked in 2018.1. – Rik May 06 '18 at 22:42
-
-
All node_modules seemed as excluded in project structure and in project panel of my big project but were actually not excluded in iml file which caused index that had 15 GB and took 5 hours to make after every start of the IDE. I updated it manually based on your post and it helped. Thank you! – xMort Apr 22 '21 at 07:49
The option is now called Stop/Start Index, available from the folder context menu in solution explorer. When index is stopped, the folder will appear with "no index" annotation on the right.
I excluded the build output folder and no longer getting lengthy index refreshes after each build. Also full text search is a lot faster (near instant).

- 25,801
- 18
- 85
- 151
After applying the Mark As > Excluded
method to a folder you still might see unwanted results.
You have to explicitly mark sub-folders as well to disable certain functionalities for sub-folders.
indexing, find usages etc.

- 27
- 1
- 1
- 7
Sometimes it is not possible to mark the folder as excluded. It happens with direct node dependencies.
For that, it's a bit extreme but you can add it to Editor-> File types -> ignored file types and folders. It won't be indexed at all. It won't be shown in the project either

- 2,969
- 30
- 27