Open TiUh opened 3 months ago
The MongoDB Node.js example has a problem in the second demo script: 2_load_and_index.ts
Here the creating of a search index is defined as following:
const index = { name: indexName, definition: { mappings: { dynamic: true, fields: [ { type: "vector", path: "embedding", numDimensions: 1536, similarity: "cosine", }, ], }, }, };
but this fails with an exception. The solution is creating the index as following:
const index = { name: indexName, type: "vectorSearch", definition: { "fields": [ { "type": "vector", "path": "embedding", "numDimensions": 1536, "similarity": "cosine" } ] }
Reference: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/
@TiUh great catch! Mind to to send a PR for this?
The MongoDB Node.js example has a problem in the second demo script: 2_load_and_index.ts
Here the creating of a search index is defined as following:
but this fails with an exception. The solution is creating the index as following:
Reference: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/