Description
I’m using a custom embedding model and want to store these vectors inside Weaviate and use the nearVector function to get the top N matches. I’m able to store the properties in Weaviate, but I can’t seem to store the vector values properly. What am I missing here?
I’ve inited a collection called Posts:
await weaviate.collections.create({
name: "Posts",
properties: [
{
name: "userId",
dataType: weaviate.configure.dataType.TEXT,
skipVectorisation: true,
indexFilterable: true,
indexSearchable: true,
},
{
name: "postTitleAndText",
dataType: weaviate.configure.dataType.TEXT,
vectorizePropertyName: false,
tokenization: "lowercase",
},
{
name: "response",
dataType: weaviate.configure.dataType.TEXT,
skipVectorisation: true,
},
],
vectorizer: weaviate.configure.vectorizer.none(),
vectorIndex: weaviate.configure.vectorIndex.hnsw({
distanceMetric: "cosine",
}),
})
Then in a separate function, in a for loop, I push objects in the following form to insertMany into my collection.
weaviatePosts.push({
properties: {
userId: uuid,
postTitleAndText,
response,
},
vectors: embeddings[index].embedding,
});
const postsCollection = this.client.collections.get("Posts");
return await postsCollection.data.insertMany(weaviatePosts);
This step succeeds (uuid is created for each object), but if I try to view the object, there is no vector associated with it:
const myCollection = weaviate.collections.get("Posts");
for await (let item of myCollection.iterator({
includeVector: true,
})) {
console.log("item", item);
}
logs something like:
{
properties: {
userId: "something",
....
}
references: undefined,
uuid: 'uuid string here',
vectors: {}
}
Running a nearVector query with another embedding always returns an empty array. What am I doing wrong here? Thanks!