Indexed
Searching your Index

Search Index

How to search your Indexed collections from the CLI — flags, output fields, scores, and scripting patterns.

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

Terminal
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:

FieldDescription
[collection]The name of the collection this result came from
documentFile path, ticket ID, or page title
(chunk N/M)This chunk's position within the document
ScoreRelevance signal for this chunk; compare within the same result list
ExcerptA short text preview of the matching chunk

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.

Terminal
indexed index search "rate limiting" -c eng-tickets

Without -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:

Terminal
indexed index search "deployment pipeline" -l 20

Compact 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.

Terminal
indexed index search "deploy" --compact

No 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.”

Terminal
indexed index search "deploy" --no-content

Understanding 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 outputrelevance_score in --simple-output aligns 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 the rank field 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):

Terminal
indexed --simple-output index search "deploy" -l 10

Example 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:

Terminal
# Get the top 5 compact results and show only the first line of each
indexed index search "deploy" --compact | head -5
Terminal
# Search and save results to a file
indexed index search "architecture decisions" -l 20 --compact > search-results.txt
Terminal
# 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}'

What's Next