@@ -153,7 +153,6 @@ import Data.Monoid
153import Data.Text (Text)
153import Data.Text (Text)
154import qualified Data.Text as T
154import qualified Data.Text as T
155import Data.Time.Clock (UTCTime)
155import Data.Time.Clock (UTCTime)
156−import Data.Vector (Vector (..))
157import qualified Data.Vector as V
156import qualified Data.Vector as V
158import GHC.Generics (Generic)
157import GHC.Generics (Generic)
159import Network.HTTP.Client
158import Network.HTTP.Client
@@ -754,15 +753,15 @@ data MultiMatchQueryType =
754 | MultiMatchPhrasePrefix deriving (Eq, Show)
753 | MultiMatchPhrasePrefix deriving (Eq, Show)
756data BoolQuery =
755data BoolQuery =
757− BoolQuery { boolQueryMustMatch :: Maybe Query
756+ BoolQuery { boolQueryMustMatch :: [Query]
758− , boolQueryMustNotMatch :: Maybe Query
757+ , boolQueryMustNotMatch :: [Query]
759− , boolQueryShouldMatch :: Maybe [Query]
758+ , boolQueryShouldMatch :: [Query]
760 , boolQueryMinimumShouldMatch :: Maybe MinimumMatch
759 , boolQueryMinimumShouldMatch :: Maybe MinimumMatch
761 , boolQueryBoost :: Maybe Boost
760 , boolQueryBoost :: Maybe Boost
762 , boolQueryDisableCoord :: Maybe DisableCoord
761 , boolQueryDisableCoord :: Maybe DisableCoord
763 } deriving (Eq, Show)
762 } deriving (Eq, Show)
765−mkBoolQuery :: Maybe Query -> Maybe Query -> Maybe [Query] -> BoolQuery
764+mkBoolQuery :: [Query] -> [Query] -> [Query] -> BoolQuery
766mkBoolQuery must mustNot should =
765mkBoolQuery must mustNot should =
767 BoolQuery must mustNot should Nothing Nothing Nothing
766 BoolQuery must mustNot should Nothing Nothing Nothing
@@ -1155,7 +1154,7 @@ instance ToJSON Query where
1155omitNulls :: [(Text, Value)] -> Value
1154omitNulls :: [(Text, Value)] -> Value
1156omitNulls = object . filter notNull where
1155omitNulls = object . filter notNull where
1157 notNull (_, Null) = False
1156 notNull (_, Null) = False
1158− notNull (_, (Array a)) = V.null a
1157+ notNull (_, (Array a)) = (not . V.null) a
1159 notNull _ = True
1158 notNull _ = True