Zvec Logo

Retrieve Documents

Use fetch() to retrieve documents by their ids.
This is a direct lookup — no search, scoring, or filtering is involved.

Fetch documents
# 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 id or a list of document ids.
  • Output: A dictionary mapping each found id to its document.
  • Missing ids are silently omitted from the result (no error raised).
  • The returned dictionary does not guarantee input order — access documents by id instead.