Skip to content

Commit 122b89b

Browse files
committed
fix: update search index id
1 parent 7d7a243 commit 122b89b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

infra/scripts/index_scripts/03_cu_process_data_text.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,7 @@ def prepare_search_doc(content, document_id):
202202
for chunk in chunks:
203203
chunk_num += 1
204204
chunk_id = document_id + '_' + str(chunk_num).zfill(2)
205-
# d = {
206-
# "chunk_id" : document_id + '_' + str(chunk_num).zfill(2),
207-
# "content": chunk,
208-
# }
205+
209206
try:
210207
v_contentVector = get_embeddings(str(chunk),openai_api_base,openai_api_version,openai_api_key)
211208
except:
@@ -215,7 +212,7 @@ def prepare_search_doc(content, document_id):
215212
except:
216213
v_contentVector = []
217214
result = {
218-
"id": base64.urlsafe_b64encode(bytes(chunk_id, encoding='utf-8')).decode('utf-8'),
215+
"id": chunk_id,
219216
"chunk_id": chunk_id,
220217
"content": chunk,
221218
"sourceurl": path.name.split('/')[-1],

0 commit comments

Comments
 (0)