Find answers from the community

Updated 3 months ago

Hi everyone, how can i get the all nodes

Hi everyone, how can i get the all nodes from en existing pg vector store to use it for bm25 retriever? I've already tried to get it with:
Plain Text
index = VectorStoreIndex.from_vector_store(vector_store=vector_store)
nodes = index.docstore.docs.values()
print("nodes: ", nodes)


nodes: dict_values([])

It returns an empty dict even it has a value in the table
W
D
9 comments
Yeah the reason why it returns empty is because nodes are not present locally , they are stored in the vector stores.

You have the pg_client, Use that client to fetch all the data from vector store and then feed it to BM25
@WhiteFang_Jr Thank you so much, is there any examples or documents to get help? I'm new to llamaindex
I don't wnat to read the document every time i want to retrieve with bm25
Actually What I suggested in not implemented in PG vector store I think. 😅
But since you already have the client for PG vector store so its like DB connection client. You can use that and check on Postgress vector store official docs how they retrieve all the docs
Retrieve whole data and then feed it to BM25
Yeah i'm using pgvector
I don't know why is it too hard to get all nodes from the db 😄
Its not implemented as the core code only requires to fetch only the relatable items based on user query
@WhiteFang_Jr thank you
Add a reply
Sign up and join the conversation on Discord