Hi,
I want to create vector search index using Java, springboot and mongoCK.
Can anyone guide me how can I do so,
I was able to create vector search index through below given mediums-
- Atlas UI
- Atlas Search API
- Atlas CLI
Is it possible to create using mongoCK or mongo template.
I am currently using the below mentioned code -
Document vectorField = new Document(“type”, “vector”)
.append(“numDimensions”, 1536)
.append(“path”, “embeddings”)
.append(“similarity”,“euclidean”);Document mapping = new Document("dynamic", true).append("fields", new Document("embeddings", vectorField)); IndexOptions indexOptions = new IndexOptions().name("embeddings_vector_index"); Document mapping = new Document("dynamic", true).append("fields", new Document("embeddings", vectorField)); IndexOptions indexOptions = new IndexOptions().name("embeddings_vector_index"); return collection.createIndex(mapping, indexOptions);
But getting an error.
Regards,
Deepak Dev