@zabaca/lattice 1.0.17 → 1.0.19
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.
- package/dist/main.js +5 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -801,24 +801,24 @@ class GraphService {
|
|
|
801
801
|
return [];
|
|
802
802
|
}
|
|
803
803
|
}
|
|
804
|
-
async createVectorIndex(
|
|
804
|
+
async createVectorIndex(_label, property, dimensions) {
|
|
805
805
|
try {
|
|
806
|
-
const indexKey =
|
|
806
|
+
const indexKey = `nodes_${property}`;
|
|
807
807
|
if (this.vectorIndexes.has(indexKey)) {
|
|
808
808
|
return;
|
|
809
809
|
}
|
|
810
810
|
const conn = await this.ensureConnected();
|
|
811
811
|
try {
|
|
812
812
|
await conn.run(`
|
|
813
|
-
CREATE INDEX
|
|
813
|
+
CREATE INDEX idx_embedding_nodes
|
|
814
814
|
ON nodes USING HNSW (embedding)
|
|
815
815
|
WITH (metric = 'cosine')
|
|
816
816
|
`);
|
|
817
|
+
this.logger.log(`Created HNSW vector index on nodes.${property} with ${dimensions} dimensions`);
|
|
817
818
|
} catch {
|
|
818
|
-
this.logger.debug(`Vector index on
|
|
819
|
+
this.logger.debug(`Vector index on nodes.${property} already exists`);
|
|
819
820
|
}
|
|
820
821
|
this.vectorIndexes.add(indexKey);
|
|
821
|
-
this.logger.log(`Created vector index on ${label}.${property} with ${dimensions} dimensions`);
|
|
822
822
|
} catch (error) {
|
|
823
823
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
824
824
|
if (!errorMessage.includes("already exists")) {
|