Retrieve Documents
Use fetch() to retrieve documents by their ids.
This is a direct lookup — no search, scoring, or filtering is involved.
# Fetch a single document
result = collection.fetch(ids="book_1")
print(result) # { "book_1": Doc(...) }
# Fetch multiple documents
result = collection.fetch(ids=["book_1", "book_2", "book_3"])
print(result) # { "book_1": Doc(...), "book_2": Doc(...), "book_3": Doc(...) }- Input: A single document
idor a list of documentids. - Output: A dictionary mapping each found
idto its document. - Missing
ids are silently omitted from the result (no error raised). - The returned dictionary does not guarantee input order — access documents by
idinstead.