Skip to content

Commit 47ed844

Browse files
Fill Document.id when building the Document from a search
1 parent 83ef833 commit 47ed844

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libs/elasticsearch/langchain_elasticsearch/_utilities.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def _hits_to_docs_scores(
7171

7272
def default_doc_builder(hit: Dict) -> Document:
7373
return Document(
74+
id=hit["_id"],
7475
page_content=hit["_source"].get(content_field, ""),
7576
metadata=hit["_source"].get("metadata", {}),
7677
)

0 commit comments

Comments
 (0)