Fix search aggs
This commit is contained in:
parent
4e3a990ac6
commit
530b7e2ab6
|
|
@ -58,12 +58,14 @@ class CustomFacetedSearchFilterBackend(FacetedSearchFilterBackend):
|
||||||
qs.query = queryset.query._clone()
|
qs.query = queryset.query._clone()
|
||||||
filterer = makefilter(__facet)
|
filterer = makefilter(__facet)
|
||||||
for param_type in ['must', 'must_not', 'should']:
|
for param_type in ['must', 'must_not', 'should']:
|
||||||
qs.query._proxied._params[param_type] = list(
|
if qs.query._proxied._params.get(param_type):
|
||||||
filter(
|
qs.query._proxied._params[param_type] = list(
|
||||||
filterer, qs.query._proxied._params[param_type]
|
filter(
|
||||||
|
filterer, qs.query._proxied._params[param_type]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
sh = qs.query._proxied._params.get('should')
|
||||||
if not len(qs.query._proxied._params['should']) \
|
if (not sh or not len(sh)) \
|
||||||
and qs.query._proxied._params.get('minimum_should_match'):
|
and qs.query._proxied._params.get('minimum_should_match'):
|
||||||
qs.query._proxied._params.pop('minimum_should_match')
|
qs.query._proxied._params.pop('minimum_should_match')
|
||||||
facet_name = '_filter_' + __field
|
facet_name = '_filter_' + __field
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user