Skip to content

Commit 33e3afc

Browse files
committed
format intern id of chunk
1 parent 3673559 commit 33e3afc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

api/helpers/_elasticsearchvectorstore.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import hashlib
12
import logging
23

34
from elasticsearch import AsyncElasticsearch, helpers
@@ -178,6 +179,7 @@ async def upsert(
178179
actions = [
179180
{
180181
"_index": self.index_name,
182+
"_id": hashlib.sha256(f"{chunk.collection_id}|{chunk.document_id}|{chunk.id}".encode()).hexdigest(),
181183
"_source": {
182184
"id": chunk.id,
183185
"collection_id": chunk.collection_id,

0 commit comments

Comments
 (0)