Skip to content

Commit

Permalink
Only set if not already set
Browse files Browse the repository at this point in the history
  • Loading branch information
gherceg committed Apr 23, 2024
1 parent 7a5f00e commit 18e75b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion corehq/apps/es/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ def _search(self, query, **kw):
if ES_QUERY_PREFERENCE.enabled(domain):
# Use domain as key to route to a consistent set of shards.kwargs
# See https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-request-preference.html
kw['preference'] = domain
if 'preference' not in kw:
kw['preference'] = domain

with metrics_histogram_timer(
'commcare.elasticsearch.search.timing',
Expand Down

0 comments on commit 18e75b4

Please sign in to comment.