Find answers from the community

Updated 2 months ago

hello guys, can you help me?

hello guys, can you help me?

I have this error in my project: Error during search: 'VectorStoreIndex' object has no attribute 'document_ids'
Risultati della ricerca: []

my script:

def search(query):
session = Session()
try:
# Crea un indice VectorStore a partire dai documenti
index = VectorStoreIndex.from_documents(get_documents(query))

# Ottieni le descrizioni dai documenti
descriptions = []
for document_id in index.document_ids():
# Query per ottenere la descrizione dal database
result = session.query(Document.description).filter(Document.id == document_id).first()
if result:
descriptions.append(result[0])
else:
descriptions.append("")
I can't find anything in the docs
W
N
3 comments
You want to iterate on the docs ingested into the index?

You'll get thosse like this:
nodes = index.docstore.docs
the use case of my application is: embedding the user's request, similarity search in the vectorDB, returning the results to the caller of the api
Add a reply
Sign up and join the conversation on Discord