From 0d3b4dfab6509a9f8cd5cc6406fe2e60185d9763 Mon Sep 17 00:00:00 2001 From: KBOCPDocs Date: Fri, 3 May 2024 11:34:40 -0400 Subject: [PATCH] Changing if-block scope Signed-off-by: KBOCPDocs --- backend/app/services/search.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/app/services/search.py b/backend/app/services/search.py index 8393929a..726dbee9 100644 --- a/backend/app/services/search.py +++ b/backend/app/services/search.py @@ -93,14 +93,14 @@ async def post(self, query, indice=None, size=10000, start_date=None, end_date=N query['query']['bool']['filter']['range'][timestamp_field]['gte'] = str(new_start_date) if end_date: query['query']['bool']['filter']['range'][timestamp_field]['lte'] = str(end_date) - if end_date is None: - response = await self.new_es.search( - index=self.new_index+"*", - body=jsonable_encoder(query), - size=size) - new_results = response['hits']['hits'] - else: - new_results = await self.scan_indices(self.new_es, self.new_index, query, timestamp_field, new_start_date, end_date, size) + if end_date is None: + response = await self.new_es.search( + index=self.new_index+"*", + body=jsonable_encoder(query), + size=size) + new_results = response['hits']['hits'] + else: + new_results = await self.scan_indices(self.new_es, self.new_index, query, timestamp_field, new_start_date, end_date, size) return await self.remove_duplicates(previous_results + new_results) else: if start_date and end_date: