Could not import multiple vectors into collection using insert many

Query:
I am trying to add multiple vectors from a DataFrame into a collection using the following code, but I notice that the vectors are not being added to the collection. Am I missing something or doing anything wrong?

Code:

import weaviate.classes as wvc

res = []
for i, row in d.iterrows():
    res.append(wvc.data.DataObject(
        properties={
            "a": row["a"],
            "b": row["b"]
        },
        vector={
            "a_vector": emb[row["a"]],
            "b_vector": emb[row["b"]]
        }
    ))

questions = client.collections.get("collection_name")
questions.data.insert_many(res)

Verification:
To verify the data, I used the following snippet:

for item in questions.iterator():
    print(item.uuid, item.vector, item.properties)

However, while I can retrieve the uuid and properties correctly, the vector is always empty ({}).

Could you please help identify the issue? Am I misunderstanding how to add vectors or missing a step in the process?

answer here: Scores for Hybrid search - #6 by DudaNogueira

Thank you for response @DudaNogueira

1 Like