Skip to content

Commit

Permalink
feat: only explain queries in dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
HAEKADI committed Nov 3, 2023
1 parent 5d734cd commit 398ae21
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions aio/aio-proxy/aio_proxy/search/es_search_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from datetime import timedelta

from aio_proxy.request.search_type import SearchType
from aio_proxy.response.helpers import is_dev_env
from aio_proxy.search.es_index import StructureMapping
from aio_proxy.search.geo_search import build_es_search_geo_query
from aio_proxy.search.helpers.helpers import (
Expand Down Expand Up @@ -68,9 +69,12 @@ def execute_and_format_es_search(self):
self.es_search_results.append(matching_structure_dict)

def sort_and_execute_es_search_query(self):
self.es_search_client = self.es_search_client.extra(
track_scores=True, explain=True
)
self.es_search_client = self.es_search_client.extra(track_scores=True)

# explain query result in dev env
if is_dev_env():
self.es_search_client = self.es_search_client.extra(explain=True)

# Collapse is used to aggregate the results by siren. It is the consequence of
# separating large documents into smaller ones

Expand Down

0 comments on commit 398ae21

Please sign in to comment.