Search Index
Searching your Index
By the end of this guide, you will know how to search across all your collections, scope a search to a specific collection, tune result count, interpret relevance scores, and pipe results into scripts.
Want Claude, Codex, Cursor, or Copilot to search for you? → MCP Integration
Prerequisites
- Indexed installed and at least one collection created (see Indexing Overview)
Basic Search
indexed index search "authentication guide"Results for 'authentication guide' (top 5):
1. [my-docs] auth-setup.md (chunk 2/4)
Score: 0.82
...To configure SSO authentication, first set up your identity
provider with the following SAML settings...
2. [my-docs] onboarding.md (chunk 5/8)
Score: 0.74
...New team members should request access through the auth
portal at auth.internal.company.com...
3. [eng-tickets] ENG-1847: SSO refresh token expiration handling (chunk 1/2)
Score: 0.71
...Users experience session drops when the SSO refresh token
expires during long-running operations...Output field reference:
| Field | Description |
|---|---|
[collection] | The name of the collection this result came from |
document | File path, ticket ID, or page title |
(chunk N/M) | This chunk's position within the document |
Score | Relevance signal for this chunk; compare within the same result list |
| Excerpt | A short text preview of the matching chunk |
Scoped Search
Use -c to search only one collection. This is useful when you know the answer is in a specific source — for example, searching only your Jira collection for a ticket, or only your docs collection for a procedure.
indexed index search "rate limiting" -c eng-ticketsWithout -c, Indexed searches all collections and merges results by score.
Tuning Results
More results — increase the limit with -l when the default five results aren't enough. Useful when doing exploratory research or when you know a topic appears in many chunks:
indexed index search "deployment pipeline" -l 20Compact list — same search, but a condensed list instead of the default card layout (first hit expanded, following rows summarized). Good for scanning many hits or terminal width. See the flag table in Index commands.
indexed index search "deploy" --compactNo content previews — hide chunk text previews so the terminal shows metadata-oriented rows (collection, document, chunk position, score). Pairs well with high -l when you only need “what matched.”
indexed index search "deploy" --no-contentUnderstanding Scores
In the default card view, Score is a numeric signal for each row. Row order is the source of truth for relevance; use the score to see how far apart neighboring hits are, not as a calibrated percentage.
- Strong vs weak — compare scores within one query’s result list. A gap between the first and fifth hit usually matters more than the absolute number.
- Corpus effects — small or single-topic collections often compress the spread; off-topic queries can still return mid-range numbers.
- JSON output —
relevance_scorein--simple-outputaligns with the same ordering as the terminal, but the scale may not match the printed column and is not guaranteed to be “higher is better.” Prefer therankfield or preserve CLI sort order when scripting.
If you need hard cutoffs, tune [core.v1.search] in your workspace config.toml (for example score_threshold) and validate against your own queries.
Search Tips
- Use natural language, not keywords. "How do we rotate API keys?" performs better than "api key rotation".
- Describe the concept, not the exact words. The index understands that "authentication timeout" and "SSO session drop" are related concepts.
- Longer queries often score better. Adding context helps the embedding model understand your intent.
- Try rephrasing if results are poor. If the first query returns weak results, approach the same topic from a different angle — use synonyms or describe the problem rather than the solution.
- Semantic search works best across a rich corpus. Collections with many documents produce more discriminating scores than collections with just a handful of files.
JSON and scripting
For machine-readable output, put the global --simple-output flag before the subcommand (full flag list: Index commands):
indexed --simple-output index search "deploy" -l 10Example response shape (one hit shown; your paths and numeric scores will differ):
{
"query": "deploy",
"total_collections_searched": 1,
"total_documents_found": 3,
"total_chunks_found": 8,
"results": [
{
"rank": 1,
"relevance_score": 1.56,
"collection": "my-docs",
"document_id": "deploy.md",
"document_url": "file:///path/to/deploy.md",
"chunk_number": 2,
"text": "Rolling deploys use the canary pool first…"
}
]
}results is ordered by relevance. Combine with -c / -l / --no-content on the command line as usual; --compact only affects human-readable terminal output.
Human-readable scripting still works with --compact / --no-content and shell tools:
Shell pipelines
Use --compact and standard shell tools to process results programmatically:
# Get the top 5 compact results and show only the first line of each
indexed index search "deploy" --compact | head -5# Search and save results to a file
indexed index search "architecture decisions" -l 20 --compact > search-results.txt# Use in a pipeline — find relevant tickets and open the first one
indexed index search "auth timeout" -c eng-tickets --compact \
| head -1 \
| awk '{print $2}'