MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / semanticSearch

Method semanticSearch

src/core/search.ts:1081–1098  ·  view source on GitHub ↗
(
    query: string,
    limit: number,
    filters?: SearchFilters
  )

Source from the content-addressed store, hash-verified

1079 }
1080
1081 private async semanticSearch(
1082 query: string,
1083 limit: number,
1084 filters?: SearchFilters
1085 ): Promise<{ chunk: CodeChunk; score: number }[]> {
1086 if (!this.embeddingProvider || !this.storageProvider) {
1087 return [];
1088 }
1089
1090 const queryVector = await this.embeddingProvider.embed(query);
1091
1092 const results = await this.storageProvider.search(queryVector, limit, filters);
1093
1094 return results.map((r) => ({
1095 chunk: r.chunk,
1096 score: r.score
1097 }));
1098 }
1099
1100 private async keywordSearch(
1101 query: string,

Callers 1

collectHybridMatchesMethod · 0.95

Calls 2

embedMethod · 0.65
searchMethod · 0.65

Tested by

no test coverage detected