Skip to content

Commit

Permalink
Fix the bug in index
Browse files Browse the repository at this point in the history
  • Loading branch information
richarddwang committed Sep 15, 2023
1 parent f9f1340 commit 8f364a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/langchain/langchain/indexes/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ def index(
# Filter out documents that already exist in the record store.
uids = []
docs_to_index = []
for doc, hashed_doc, doc_exists in zip(doc_batch, hashed_docs, exists_batch):
for hashed_doc, doc_exists in zip(hashed_docs, exists_batch):
if doc_exists:
# Must be updated to refresh timestamp.
record_manager.update([hashed_doc.uid], time_at_least=index_start_dt)
num_skipped += 1
continue
uids.append(hashed_doc.uid)
doc = Document(page_content=hashed_doc.page_content, metadata=hashed_doc.metadata)
docs_to_index.append(doc)

# Be pessimistic and assume that all vector store write will fail.
Expand Down

0 comments on commit 8f364a5

Please sign in to comment.