From a94be6ddb28986c211e6b2b550c82be913429ab0 Mon Sep 17 00:00:00 2001 From: Ali Date: Thu, 12 Dec 2024 01:46:37 +0100 Subject: [PATCH] puuuush index auf doc_id feld sollte gehen --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 8c586a1..981238f 100644 --- a/main.py +++ b/main.py @@ -82,7 +82,10 @@ def insert_data_mongo(id, filepath,pChunk): 'filepath': filepath, 'chunk_content': pChunk, } - collection.insert_one(dokument) + result = collection.insert_one(dokument) + + if result.acknowledged: + collection.create_index("doc_id") def reload_files(): # path = input("Please provider path to folder: ")