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 minScore?: number, // minimum score threshold (0–1) 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 contextScoreDiscount?: number, // score multiplier for neighbour chunks — default: 0.7}SearchResult
Section titled “SearchResult”{ chunk: CodeChunk, score: number, // higher = more relevant matchType: 'semantic' | 'lexical' | 'hybrid',}