Usage
Options
Run git pull before re-indexing (deprecated — use update-cmd instead)
How It Works
For each collection:- Run update command — If configured, executes pre-update shell command (e.g.,
git pull) - Scan files — Finds all files matching the collection’s glob pattern
- Compare hashes — Detects new, modified, and deleted files
- Update index — Adds new content, updates changed files, removes deleted files
- Clean up — Removes orphaned content hashes and inactive documents
Update Commands
Configure per-collection update commands:Examples
Output
Shows progress for each collection:What Gets Updated
New Files
Files matching the glob pattern that weren’t indexed before:- Content hash calculated
- Title extracted from first heading or filename
- Document inserted with metadata
Modified Files
Files with changed content (different hash):- New content hash inserted
- Document updated with new hash and title
- Old content preserved if referenced elsewhere
Unchanged Files
Files with same content hash:- No changes (count shown for transparency)
- Title updated if different
Deleted Files
Previously indexed files no longer matching pattern:- Document marked inactive
- Content hash retained (may be used elsewhere)
- Virtual path removed from queries
Orphaned Content
Content hashes not referenced by any active document:- Removed from database
- Saves storage space
Caches Cleared
Update clears:- LLM cache — Query expansion and reranking caches
- Ensures fresh results with new content
After Updating
QMD checks if embeddings need updating:Collection Update Commands
Best practices:Performance
Update speed depends on:- File count — More files = longer scan
- Changed files — Only changed files are re-hashed
- Update commands — Git operations can be slow on large repos
- 100 files: 1-2 seconds
- 1,000 files: 5-10 seconds
- 10,000 files: 30-60 seconds
Related Commands
qmd collection update-cmd
Configure pre-update commands
qmd embed
Update vector embeddings
qmd status
Check index health
qmd collection
Manage collections