Skip to main content
Re-index all collections, updating the search index with new or changed files.

Usage

qmd update [options]

Options

--pull
boolean
default:"false"
Run git pull before re-indexing (deprecated — use update-cmd instead)

How It Works

For each collection:
  1. Run update command — If configured, executes pre-update shell command (e.g., git pull)
  2. Scan files — Finds all files matching the collection’s glob pattern
  3. Compare hashes — Detects new, modified, and deleted files
  4. Update index — Adds new content, updates changed files, removes deleted files
  5. Clean up — Removes orphaned content hashes and inactive documents

Update Commands

Configure per-collection update commands:
# Set git pull as update command
qmd collection update-cmd notes 'git pull'

# Complex update command
qmd collection update-cmd wiki 'git stash && git pull --rebase && git stash pop'

# View configured command
qmd collection show notes
Update commands run in the collection’s directory with exit code checking.

Examples

# Re-index all collections
qmd update

# Legacy: git pull all collections (deprecated)
qmd update --pull

Output

Shows progress for each collection:
Updating 3 collection(s)...

[1/3] notes (**/*.md)
    Running update command: git pull
    Already up to date.
Indexing: 42/42 ETA: 0s
Indexed: 5 new, 8 updated, 29 unchanged, 2 removed

[2/3] journals (**/*.md)
Indexing: 156/156
Indexed: 12 new, 0 updated, 144 unchanged, 0 removed

✓ All collections updated.

Run 'qmd embed' to update embeddings (17 unique hashes need vectors)

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:
# If new content needs vectors:
qmd embed

# Check what needs embedding:
qmd status

Collection Update Commands

Best practices:
# Git pull with safety
qmd collection update-cmd notes 'git pull --ff-only'

# Pull with stash
qmd collection update-cmd wiki 'git stash && git pull --rebase && git stash pop'

# Sync from remote (non-git)
qmd collection update-cmd docs 'rsync -av remote:/docs/ .'

# Clear update command
qmd collection update-cmd notes

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
Typical performance:
  • 100 files: 1-2 seconds
  • 1,000 files: 5-10 seconds
  • 10,000 files: 30-60 seconds

qmd collection update-cmd

Configure pre-update commands

qmd embed

Update vector embeddings

qmd status

Check index health

qmd collection

Manage collections

Build docs developers (and LLMs) love