Conditional Rules
Overview
Conditional rules allow you to control which files and folders are indexed by FileBrowser Quantum. Use rules to exclude system files, temporary directories, or large archives while keeping your UI clean and search results relevant.
Basic Structure
Rules are configured under conditionals in your source configuration:
Global Flags
These flags apply to the entire source:
ignoreHidden
Skip all hidden files and folders (those starting with .). Hidden items don’t appear in UI or search. Defaults to false. Useful for automatically excluding system files like .git and .DS_Store.
ignoreZeroSizeFolders
Skip folders with zero calculated size. Empty folders or folders containing only empty folders are ignored. Defaults to false. Cleans up UI by hiding empty directory structures.
You can still create folders via the UI. They must be populated by the next index scan to remain visible.
Rule Types
Individual rules are specified in the rules array. Each rule targets specific files or folders.
Path-Based Rules
Target specific paths within your source.
folderPath
Matches exact folder path relative to source root. For example, folderPath: "logs" matches /data/logs but not /data/project/logs. Use this to exclude specific known directories.
filePath
Matches exact file path relative to source root. For example, filePath: "data.db" matches /data/data.db but not /data/backup/data.db. Use this to exclude specific known files.
Name-Based Rules (Global)
These rules apply anywhere within the source.
folderNames
Matches any folder with this exact name, anywhere in the source. For example, folderNames: "node_modules" excludes all node_modules directories. Useful for excluding common folder names like cache or build directories.
fileNames
Matches any file with this exact name, anywhere in the source. For example, fileNames: ".DS_Store" excludes all .DS_Store files. Useful for excluding system or temporary files by name.
Pattern-Based Rules (Global)
Match files and folders based on name patterns.
folderStartsWith
Matches folders whose names start with the specified prefix, anywhere in the source. For example, folderStartsWith: "tmp-" excludes tmp-cache, tmp-build, etc. Useful for excluding folders with naming conventions.
folderEndsWith
Matches folders whose names end with the specified suffix, anywhere in the source. For example, folderEndsWith: ".git" excludes .git folders. Useful for excluding folders by suffix pattern.
fileStartsWith
Matches files whose names start with the specified prefix, anywhere in the source. For example, fileStartsWith: "._" excludes macOS metadata files. Useful for excluding temporary or system files.
fileEndsWith
Matches files whose names end with the specified suffix, anywhere in the source. For example, fileEndsWith: ".tmp" excludes all temporary files. Useful for excluding files by extension or suffix.
Special Rules
includeRootItem
Only show specified items at the root level of the source. For example, with the rules above, only public and downloads folders appear at source root. Useful for restricting visibility to specific root directories or files.
When using includeRootItem, only the specified items are visible at the root level. All other root items are hidden.
neverWatchPath
Folder is indexed once initially, then never rescanned automatically. You can still manually refresh by viewing the folder in the UI. Useful for large, rarely-changing directories to save resources.
Example:
viewable
Can be added to any rule type. Folder/file appears in UI but is excluded from search and size calculations. Useful for showing directories for browsing without indexing their contents.
Example:
Users can browse old-projects but it won’t appear in search results or affect folder sizes.
Complete Examples
Clean Development Environment
Exclude common development artifacts:
| |
Media Library with Archives
Show archive folders but don’t index them:
| |
Restricted Public Share
Only expose specific directories:
Enterprise File Server
Comprehensive exclusions for corporate environment:
| |
Rule Priority and Behavior
How Rules Are Applied
- Global flags first:
ignoreHiddenandignoreZeroSizeFoldersare checked first - Rules are OR-based: If any rule matches an item, it’s excluded
- Path rules are exact:
folderPath: "temp"only matches/temp, not/project/temp - Name rules are global:
folderNames: "temp"matches anytempfolder anywhere - Viewable overrides exclusion: Adding
viewable: trueshows the item in UI
Common Patterns
Exclude by Extension
Removes temporary and log files.
Exclude System Files
Clean UI without system clutter.
Show Large Archives
Browsable but not indexed or rescanned.
Best Practices
- Start with hidden files: Enable
ignoreHidden: truefor cleaner UI - Use global rules for common patterns:
folderNamesandfileNameswork everywhere - Path rules for specific exclusions: Use
folderPathfor known directories - Consider viewable for archives: Show large stable folders without indexing overhead
- Test your rules: Verify excluded items don’t appear in search
Performance Tips
- Use
neverWatchPathfor large, stable directories to save resources - Enable
ignoreZeroSizeFoldersif you have many empty directories - Exclude large development folders like
node_modulesto speed up scans - Use
viewablefor archives to show them without search overhead