Skip to content

Commit

Permalink
Merge pull request #94 from vishnuchalla/bug-fix
Browse files Browse the repository at this point in the history
[Bug fix] Changing if-block scope
  • Loading branch information
vishnuchalla authored May 15, 2024
2 parents afd14b8 + 0d3b4df commit 309a5a1
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 309a5a1

Please sign in to comment.