gitnexus 1.6.13-rc.77 → 1.6.13-rc.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -108,7 +108,7 @@ export async function augment(pattern, cwd) {
|
|
|
108
108
|
await initLbug(repoId, repo.lbugPath);
|
|
109
109
|
}
|
|
110
110
|
// Step 1: BM25 search (fast, no embeddings)
|
|
111
|
-
const { results: bm25Results
|
|
111
|
+
const { results: bm25Results } = await searchFTSFromLbug(pattern, 10, repoId);
|
|
112
112
|
// Step 2: Map BM25 file results to symbols
|
|
113
113
|
const symbolMatches = [];
|
|
114
114
|
for (const result of bm25Results.slice(0, 5)) {
|
|
@@ -135,14 +135,16 @@ export async function augment(pattern, cwd) {
|
|
|
135
135
|
/* skip */
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
|
|
138
|
+
// FTS ranks files by mentions, so a widely referenced symbol's definition
|
|
139
|
+
// may not be present in the top file results. Fall back to graph names
|
|
140
|
+
// whenever those files produce no symbol match, regardless of FTS health.
|
|
141
|
+
if (symbolMatches.length === 0) {
|
|
141
142
|
const fallbackRows = await executeQuery(repoId, `
|
|
142
143
|
MATCH (n)
|
|
143
144
|
WHERE n.name CONTAINS '${patternFirstWord}'
|
|
144
|
-
RETURN n.id AS id, n.name AS name, labels(n)[0] AS type, n.filePath AS filePath
|
|
145
|
-
|
|
145
|
+
RETURN n.id AS id, n.name AS name, labels(n)[0] AS type, n.filePath AS filePath,
|
|
146
|
+
CASE WHEN n.name = '${patternFirstWord}' THEN 0 ELSE 1 END AS exactRank
|
|
147
|
+
ORDER BY exactRank, id
|
|
146
148
|
LIMIT 5
|
|
147
149
|
`).catch(() => []);
|
|
148
150
|
for (const sym of fallbackRows) {
|
package/package.json
CHANGED