gitnexus 1.6.10-rc.34 → 1.6.10-rc.35
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.
|
@@ -178,7 +178,6 @@ const queryFallbackFileNodes = async (executeQuery) => {
|
|
|
178
178
|
* Batch INSERT chunk-aware embeddings into CodeEmbedding table
|
|
179
179
|
*/
|
|
180
180
|
export const batchInsertEmbeddings = async (executeWithReusedStatement, updates) => {
|
|
181
|
-
const cypher = `CREATE (e:${EMBEDDING_TABLE_NAME} {id: $id, nodeId: $nodeId, chunkIndex: $chunkIndex, startLine: $startLine, endLine: $endLine, embedding: $embedding, contentHash: $contentHash})`;
|
|
182
181
|
const paramsList = updates.map((u) => ({
|
|
183
182
|
id: `${u.nodeId}:${u.chunkIndex}`,
|
|
184
183
|
nodeId: u.nodeId,
|
|
@@ -188,6 +187,10 @@ export const batchInsertEmbeddings = async (executeWithReusedStatement, updates)
|
|
|
188
187
|
embedding: u.embedding,
|
|
189
188
|
contentHash: u.contentHash ?? STALE_HASH_SENTINEL,
|
|
190
189
|
}));
|
|
190
|
+
if (paramsList.length === 0)
|
|
191
|
+
return;
|
|
192
|
+
await executeWithReusedStatement(`MATCH (e:${EMBEDDING_TABLE_NAME} {id: $id}) DELETE e`, paramsList.map(({ id }) => ({ id })));
|
|
193
|
+
const cypher = `CREATE (e:${EMBEDDING_TABLE_NAME} {id: $id, nodeId: $nodeId, chunkIndex: $chunkIndex, startLine: $startLine, endLine: $endLine, embedding: $embedding, contentHash: $contentHash})`;
|
|
191
194
|
await executeWithReusedStatement(cypher, paramsList);
|
|
192
195
|
};
|
|
193
196
|
/**
|
package/package.json
CHANGED