Skip to content

Commit

Permalink
Do not allow __ to dot expansion in FacetedSearch
Browse files Browse the repository at this point in the history
Fixes #954
  • Loading branch information
honzakral committed Sep 25, 2019
1 parent 89200d2 commit e74ab2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions elasticsearch_dsl/faceted_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class TermsFacet(Facet):
def add_filter(self, filter_values):
""" Create a terms filter instead of bool containing term filters. """
if filter_values:
return Terms(**{self._params['field']: filter_values})
return Terms(_expand__to_dot=False, **{self._params['field']: filter_values})


class RangeFacet(Facet):
Expand Down Expand Up @@ -126,15 +126,15 @@ def get_value_filter(self, filter_value):
if t is not None:
limits['lt'] = t

return Range(**{
return Range(_expand__to_dot=False, **{
self._params['field']: limits
})

class HistogramFacet(Facet):
agg_type = 'histogram'

def get_value_filter(self, filter_value):
return Range(**{
return Range(_expand__to_dot=False, **{
self._params['field']: {
'gte': filter_value,
'lt': filter_value + self._params['interval']
Expand Down Expand Up @@ -168,7 +168,7 @@ def get_value(self, bucket):
return bucket['key']

def get_value_filter(self, filter_value):
return Range(**{
return Range(_expand__to_dot=False, **{
self._params['field']: {
'gte': filter_value,
'lt': self.DATE_INTERVALS[self._params['interval']](filter_value)
Expand Down

0 comments on commit e74ab2c

Please sign in to comment.