I am reaching out to request assistance with retrieving all the embeddings associated with my collection named “productdata” in my Weaviate cluster. Below are the relevant details:
- Collection Name: productdata
- Cloud Region: US East
- Created At: 9/30/2024, 5:56 PM
Could you please guide me on how to retrieve all embeddings or assist with the process? Let me know if you require any further details to facilitate this request.
Good morning @Abhishek_Yadav,
Welcome to our community and glad to see you here as well.
Absolutely, you can easily read all your properties and data, including vector embeddings, from your collections by following this guide:
Here’s a code snippet I wrote for you to make things easier. You can use it right away—just pass the client to the function:
import pandas as pd
def get_all_collections_data(client):
all_data = []
collections = client.collections.list_all()
for col_name in collections:
try:
collection = client.collections.get(col_name)
collection_data = []
for item in collection.iterator(include_vector=True):
row = item.properties.copy()
row['vector'] = item.vector
collection_data.append(row)
if collection_data:
df = pd.DataFrame(collection_data)
df['collection'] = col_name
all_data.append(df)
print(f"Successfully processed: {col_name}")
except Exception as e:
print(f"Error in {col_name}: {str(e)}")
continue
return pd.concat(all_data, ignore_index=True) if all_data else pd.DataFrame()
get_all_collections_data(client)
I hope this helps, also I have followed up on your Support Ticket in our cloud as you are cloud customer so you can always use our support ticketing system.
Have a lovely weekend!
Regards,
Mohamed Shahin
Weaviate Support