Disable intellij indexing on specific folder
IndexingIntellij IdeaIndexing Problem Overview
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. Any help would be appreciated.
Indexing Solutions
Solution 1 - Indexing
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.
Solution 2 - Indexing
On IntelliJ 13+ (don't know for earlier versions), you can right click on a folder > Mark Directory As > Excluded.
Solution 3 - Indexing
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>
Solution 4 - Indexing
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).
Solution 5 - Indexing
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.
Solution 6 - Indexing
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