Filter on buckets only when there is some bucket selected (#289)
otherwise the query is malformed
This commit is contained in:
parent
cfb5e540b9
commit
7c89b2349c
|
@ -1095,9 +1095,15 @@ makeRequestBody query from sizeRaw sort type_ sortField otherSortFields bucketsF
|
|||
, Json.Encode.object
|
||||
[ ( "filter"
|
||||
, Json.Encode.list Json.Encode.object
|
||||
[ filterByType type_
|
||||
, filterByBuckets
|
||||
]
|
||||
(List.append
|
||||
[ filterByType type_ ]
|
||||
(if List.isEmpty filterByBuckets then
|
||||
[]
|
||||
|
||||
else
|
||||
[ filterByBuckets ]
|
||||
)
|
||||
)
|
||||
)
|
||||
, ( "must"
|
||||
, Json.Encode.list Json.Encode.object
|
||||
|
|
Loading…
Reference in a new issue