diff --git a/bloodhound.cabal b/bloodhound.cabal index ead7edd..3c1e490 100644 --- a/bloodhound.cabal +++ b/bloodhound.cabal @@ -32,7 +32,7 @@ library build-depends: base >= 4.3 && <5, bytestring >= 0.10.0 && <0.11, containers >= 0.5.0.0 && <0.6, - aeson >= 0.11 && <0.12, + aeson >= 0.11.1 && <0.12, http-client >= 0.3 && <0.5, network-uri >= 2.6 && <2.7, semigroups >= 0.15 && <0.19, @@ -62,7 +62,7 @@ test-suite tests http-client, http-types, containers, - hspec >= 1.8 && <2.2, + hspec >= 1.8 && <2.3, text, time, aeson, @@ -84,6 +84,8 @@ test-suite doctests hs-source-dirs: tests, src if impl(ghc >= 7.8) build-depends: base, + aeson, + bloodhound, directory, doctest >= 0.10.1, doctest-prop, diff --git a/src/Database/Bloodhound.hs b/src/Database/Bloodhound.hs index 9470a11..00acd35 100644 --- a/src/Database/Bloodhound.hs +++ b/src/Database/Bloodhound.hs @@ -1,7 +1,10 @@ module Database.Bloodhound - ( module Database.Bloodhound.Client + ( -- module Data.Aeson.Types + -- , + module Database.Bloodhound.Client , module Database.Bloodhound.Types ) where +-- import Data.Aeson.Types import Database.Bloodhound.Client import Database.Bloodhound.Types diff --git a/src/Database/Bloodhound/Types.hs b/src/Database/Bloodhound/Types.hs index e6f9e47..c9e88ee 100644 --- a/src/Database/Bloodhound/Types.hs +++ b/src/Database/Bloodhound/Types.hs @@ -4,7 +4,7 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE NoMonomorphismRestriction #-} +-- {-# LANGUAGE NoMonomorphismRestriction #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE UndecidableInstances #-} @@ -311,6 +311,7 @@ import Database.Bloodhound.Types.Internal -- $setup -- >>> :set -XOverloadedStrings +-- >>> import Data.Aeson -- >>> import Database.Bloodhound -- >>> let testServer = (Server "http://localhost:9200") -- >>> let testIndex = IndexName "twitter" @@ -2484,7 +2485,8 @@ instance FromJSON MoreLikeThisFieldQuery where <*> o .:? "percent_terms_to_match" <*> o .:? "min_term_freq" <*> o .:? "max_query_terms" - <*> (optionalNE =<< o .:? "stop_words") + -- <*> (optionalNE =<< o .:? "stop_words") + <*> o .:? "stop_words" <*> o .:? "min_doc_freq" <*> o .:? "max_doc_freq" <*> o .:? "min_word_length" @@ -2492,7 +2494,7 @@ instance FromJSON MoreLikeThisFieldQuery where <*> o .:? "boost_terms" <*> o .:? "boost" <*> o .:? "analyzer" - optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON) + -- optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON) instance ToJSON MoreLikeThisQuery where toJSON (MoreLikeThisQuery text fields percent @@ -2517,11 +2519,13 @@ instance FromJSON MoreLikeThisQuery where parseJSON = withObject "MoreLikeThisQuery" parse where parse o = MoreLikeThisQuery <$> o .: "like_text" - <*> (optionalNE =<< o .:? "fields") + -- <*> (optionalNE =<< o .:? "fields") + <*> o .:? "fields" <*> o .:? "percent_terms_to_match" <*> o .:? "min_term_freq" <*> o .:? "max_query_terms" - <*> (optionalNE =<< o .:? "stop_words") + -- <*> (optionalNE =<< o .:? "stop_words") + <*> o .:? "stop_words" <*> o .:? "min_doc_freq" <*> o .:? "max_doc_freq" <*> o .:? "min_word_length" @@ -2529,7 +2533,7 @@ instance FromJSON MoreLikeThisQuery where <*> o .:? "boost_terms" <*> o .:? "boost" <*> o .:? "analyzer" - optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON) + -- optionalNE = maybe (pure Nothing) (fmap Just . parseNEJSON) instance ToJSON IndicesQuery where toJSON (IndicesQuery indices query noMatch) = diff --git a/stack-7.10.yaml b/stack-7.10.yaml index ebb384d..0fef23b 100644 --- a/stack-7.10.yaml +++ b/stack-7.10.yaml @@ -2,7 +2,8 @@ flags: {} packages: - '.' extra-deps: -- aeson-0.10.0.0 +- aeson-0.11.1.0 +- fail-4.9.0.0 - http-types-0.9 - http-client-0.4.24 - attoparsec-0.13.0.1 @@ -11,4 +12,4 @@ extra-deps: - quickcheck-properties-0.1 - semigroups-0.18.0.1 - uri-bytestring-0.1.9 -resolver: lts-3.10 +resolver: lts-5.1