As a web developer, I use some package managers a lot, like NPM and Composer. They will install millions of source code files in one project. NPM folder is usually node_modules. With all these files indexed, what I want to find will never appear. So probably baloo can have a built in filter that exclude 'node_modules'.
Please provide a list of the filename extensions and/or patterns that you would like excluded.
I assume that hidden files and folders start with '.' have been excluded by default. Then here are some files and folder pattern I would like to exclude: * node_modules/ (NodeJS package folder, it is huge) * vendor/ (PHP Composer package folder) * README* * LICENSE * COPY * *.js * *.css * *.json * *.xml * *.php * *.py * *.c * *.h * *.cpp * *.hpp * *.o * *.so * *.py * __pycache__ (python cache folder, only contains binary files) However, here are much more source code file extensions. Many be user can search them inside their IDE, with find, or in Dolphin. But indexing all them will be expensive. User may don't want them in global search.
Created attachment 112526 [details] npm packages and source code files are filling up global search results
Also these: * *.js.map * *.css.map * *.ts * *.jsx * *.tsx
Thanks, I'll be happy to make most of these changes. Don't think we can do "vendor", since it's quite possible that a user could give that name to a non-development directory that they'd like indexed. Any chance you could provide the MIME types for the files you'd like excluded? Baloo matches by MIME type, not file extension.
Never mind, I found them. I'll submit a patch today.
Patch available: https://phabricator.kde.org/D12787
Git commit 7529727e46242d2fdd71c4e8c92363600373fcb6 by Nathaniel Graham. Committed on 15/05/2018 at 22:33. Pushed by ngraham into branch 'master'. Ignore more types of source files Summary: Add more types of development-related files to the exclusion lists. These files aren't useful to index, and having them there can bog down Baloo. Related: bug 390932, bug 382117 FIXED-IN 5.47 Test Plan: Created a bunch of files of the newly excluded types. Baloo didn't index them. Reviewers: michaelh, bruns Reviewed By: bruns Subscribers: broulik, cfeck, kde-frameworks-devel, #baloo Tags: #frameworks, #baloo Differential Revision: https://phabricator.kde.org/D12787 M +37 -5 src/file/fileexcludefilters.cpp https://commits.kde.org/baloo/7529727e46242d2fdd71c4e8c92363600373fcb6