Skip to content

Commit

Permalink
Changing if-block scope
Browse files Browse the repository at this point in the history
Signed-off-by: KBOCPDocs <[email protected]>
  • Loading branch information
vishnuchalla committed May 3, 2024
1 parent afd14b8 commit 0d3b4df
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions backend/app/services/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0d3b4df

Please sign in to comment.