Searching
Search methods
Section titled “Search methods”// Hybrid search (default: semantic + BM25 via RRF)const results = await indexer.search(query, options?);
// Semantic onlyconst results = await indexer.searchSemantic(query, options?);
// Lexical / BM25 onlyconst results = await indexer.searchLexical(query, options?);
// Hybrid + graph-context expansionconst results = await indexer.searchWithContext(query, options?);SearchOptions
Section titled “SearchOptions”{ limit?: number, // default: 10 language?: Language | Language[], // filter by language types?: ChunkType[], // filter by chunk type filePath?: string, // path filter (glob patterns supported) hybrid?: boolean, // default: true when embeddings available rerank?: boolean, // apply reranking after RRF; default: true when rerankingFunction set rrfK?: number, // RRF rank constant k; default: 45 (tuned for code retrieval)}SearchWithContextOptions
Section titled “SearchWithContextOptions”Extends SearchOptions:
{ graphDepth?: number, // BFS hops to expand — default: 1 graphRelationTypes?: RelationshipType[], // edge types to follow — default: all}SearchResult
Section titled “SearchResult”Results are always returned sorted by relevance (best first). The numeric
score used internally for ordering is not exposed — it is not comparable
across search paths (semantic / lexical / hybrid / reranked). Use
matchType to know which path produced a given result.
{ chunk: CodeChunk, matchType: 'semantic' | 'lexical' | 'hybrid',}