|
31 | 31 | from app import dependencies |
32 | 32 | from app import keycloak_auth |
33 | 33 | from app.search.connect import ( |
| 34 | + connect_elasticsearch, |
34 | 35 | insert_record, |
35 | 36 | delete_document_by_id, |
36 | 37 | update_record, |
@@ -191,6 +192,7 @@ async def save_dataset( |
191 | 192 | db: MongoClient = Depends(dependencies.get_db), |
192 | 193 | es=Depends(dependencies.get_elasticsearchclient), |
193 | 194 | ): |
| 195 | + es = await connect_elasticsearch() |
194 | 196 |
|
195 | 197 | # Check all connection and abort if any one of them is not available |
196 | 198 | if db is None or es is None: |
@@ -304,6 +306,7 @@ async def edit_dataset( |
304 | 306 | user_id=Depends(get_user), |
305 | 307 | es=Depends(dependencies.get_elasticsearchclient), |
306 | 308 | ): |
| 309 | + es = await connect_elasticsearch() |
307 | 310 |
|
308 | 311 | # Check all connection and abort if any one of them is not available |
309 | 312 | if db is None or es is None: |
@@ -347,6 +350,7 @@ async def patch_dataset( |
347 | 350 | db: MongoClient = Depends(dependencies.get_db), |
348 | 351 | es=Depends(dependencies.get_elasticsearchclient), |
349 | 352 | ): |
| 353 | + es = await connect_elasticsearch() |
350 | 354 |
|
351 | 355 | # Check all connection and abort if any one of them is not available |
352 | 356 | if db is None or es is None: |
@@ -388,6 +392,7 @@ async def delete_dataset( |
388 | 392 | fs: Minio = Depends(dependencies.get_fs), |
389 | 393 | es=Depends(dependencies.get_elasticsearchclient), |
390 | 394 | ): |
| 395 | + es = await connect_elasticsearch() |
391 | 396 |
|
392 | 397 | # Check all connection and abort if any one of them is not available |
393 | 398 | if db is None or fs is None or es is None: |
|
0 commit comments