From d0ecc92169d895021c5f1576f01eec12178d0eec Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Jul 2022 13:47:10 +0100 Subject: [PATCH] Reformat OpenSearch --- core/lib/opensearch.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/lib/opensearch.py b/core/lib/opensearch.py index d72bd89..41b91df 100644 --- a/core/lib/opensearch.py +++ b/core/lib/opensearch.py @@ -5,8 +5,9 @@ from opensearchpy import OpenSearch def initialise_opensearch(): auth = (settings.OPENSEARCH_USERNAME, settings.OPENSEARCH_PASSWORD) client = OpenSearch( + # fmt: off hosts=[{"host": settings.OPENSEARCH_URL, - "port": settings.OPENSEARCH_PORT}], + "port": settings.OPENSEARCH_PORT}], http_compress=False, # enables gzip compression for request bodies http_auth=auth, # client_cert = client_cert_path, @@ -35,5 +36,7 @@ def construct_query(query): def run_main_query(client, query): search_query = construct_query(query) - response = client.search(body=search_query, index=settings.OPENSEARCH_INDEX_MAIN) + # fmt: off + response = client.search(body=search_query, + index=settings.OPENSEARCH_INDEX_MAIN) return response