Search Internals and Advanced Usage
How Indexly turns indexed content into FTS5 and regex results, including query normalization, filters, snippets, cache behavior, and performance guidance.
Indexly searches the local index that was created by indexly index. It does not scan every file again during a search, so result quality depends on what was extracted, filtered, and stored during indexing.
Use search when you want ranked, high-signal discovery across documents, emails, source files, and structured text. Use regex when you need exact pattern matching.
Create or refresh the index first:
indexly index ./docs
For document-heavy folders, install the document extras and choose the OCR behavior intentionally:
python -m pip install "indexly[documents]"
indexly index ./docs --filetype .pdf
indexly index ./docs --ocr
indexly index ./docs --no-ocr
--ocr forces OCR for PDFs. --no-ocr disables PDF OCR entirely. Without either flag, Indexly uses the default PDF extraction policy.
The search command uses SQLite FTS5 over indexed content.
indexly search "error handling"
indexly search "invoice AND 2026"
indexly search "docker OR kubernetes"
indexly search "cache NOT redis"
indexly search "authentication NEAR failure" --near-distance 8
When a query does not contain explicit FTS operators, Indexly normalizes it as a safer literal phrase. Logical operators are opt-in and case-sensitive: use uppercase AND, OR, NOT, and NEAR when you want boolean search behavior. Lowercase English words such as and, or, not, and near stay part of the literal search text.
indexly search "search and replace"
indexly search "search AND replace"
The first command searches for the phrase search and replace. The second command searches for indexed content containing both search and replace.
Use filters to narrow the indexed result set before ranking:
indexly search "invoice" --filetype .pdf .docx
indexly search "meeting" --path-contains "projects/client-a"
indexly search "contract" --date-from 2026-01-01 --date-to 2026-03-31
indexly search "budget" --filter-tag finance
Search also supports metadata filters populated during extraction:
indexly search "ticket" --author "Mario Heidt"
indexly search "manual" --format PDF
indexly search "photo" --camera Canon
indexly search "inspection" --image-created 2026-03
By default, full-text search results are sorted by SQLite FTS relevance. You can choose another ordering:
indexly search "invoice" --sort-by relevance
indexly search "invoice" --sort-by newest
indexly search "invoice" --sort-by oldest
indexly search "invoice" --sort-by path
newest and oldest use the indexed file modified timestamp. path sorts case-insensitively by file path. Sorting is available for indexly search; regex search remains pattern-focused and does not use FTS ranking.
Increase or reduce the snippet window with --context:
indexly search "quarterly report" --context 80
By default, Indexly can reuse cached search results when they are still valid. Bypass cache reads and writes for a fresh query:
indexly search "policy" --no-cache
Save repeat searches as profiles:
indexly search "invoice" --filetype .pdf --save-profile invoice_pdf
indexly search "invoice" --profile invoice_pdf
Profiles store the search parameters and make repeated workflows easier to reproduce.
Use clear-search when stale paths or tagged batches should be removed from the local FTS5 search index without deleting source files.
Preview stale results under a moved folder:
indexly clear-search --path "V:/Hotline/OldCustomerFolder" --dry-run
Remove them after reviewing the plan:
indexly clear-search --path "V:/Hotline/OldCustomerFolder"
Remove all files matching any cleanup tag:
indexly clear-search --tag archive stale-index --dry-run
See Clear Search Results Safely for confirmation behavior, path and tag semantics, cache invalidation, and recovery steps.
Use fuzzy search when spelling or terminology may vary:
indexly search "authentcation" --fuzzy
indexly search "projetc plan" --fuzzy --fuzzy-threshold 85
Fuzzy search expands against the FTS vocabulary table. It is vocabulary-aware, not a raw filesystem scan.
Use regex for exact patterns:
indexly regex "(?i)password\s*="
indexly regex "\bINV-\d{6}\b" --filetype .txt .md
indexly regex "(?m)^timeout\s*=\s*\d+" --path-contains config
Regex search runs against indexed content and supports the same common filters as full-text search, including --filetype, --date-from, --date-to, --path-contains, --filter-tag, --context, --no-cache, --save-profile, and --profile.
| Need | Command |
|---|---|
| Ranked concept discovery | indexly search |
FTS operators such as uppercase AND, OR, NOT, NEAR |
indexly search |
| Newest or oldest indexed matches first | indexly search --sort-by newest |
| Misspelling-tolerant lookup | indexly search --fuzzy |
| Exact syntax or identifiers | indexly regex |
| Security or config audits | indexly regex with filters |
How Indexly turns indexed content into FTS5 and regex results, including query normalization, filters, snippets, cache behavior, and performance guidance.