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
|
, Json.Encode.object
|
||||||
[ ( "filter"
|
[ ( "filter"
|
||||||
, Json.Encode.list Json.Encode.object
|
, Json.Encode.list Json.Encode.object
|
||||||
[ filterByType type_
|
(List.append
|
||||||
, filterByBuckets
|
[ filterByType type_ ]
|
||||||
]
|
(if List.isEmpty filterByBuckets then
|
||||||
|
[]
|
||||||
|
|
||||||
|
else
|
||||||
|
[ filterByBuckets ]
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
, ( "must"
|
, ( "must"
|
||||||
, Json.Encode.list Json.Encode.object
|
, Json.Encode.list Json.Encode.object
|
||||||
|
|
Loading…
Reference in a new issue