git.iko.soy/typeable/bloodhound
on master help sign in
http-client-0.5.0 support
0403b19Chris Allen
Makefile+5−18
@@ -1,22 +1,9 @@
1−install-with-test-support:
1+build:
2− cabal install --enable-tests
2+ stack build
3− echo "Make certain you have an elasticsearch instance on localhost:9200 !"
4− cabal test
5
3
6test:
4test:
7 echo "Make certain you have an elasticsearch instance on localhost:9200 !"
5 echo "Make certain you have an elasticsearch instance on localhost:9200 !"
8− cabal clean
9− cabal test
10−
11−build:
12− cabal build
13−
14−test-repl:
6+ stack test
15− cabal repl tests
16−
17−repl:
18− cabal repl
19
7
20−reset:
8+ghci:
21− rm -rf .cabal-sandbox
9+ stack ghci
22− cabal sandbox init
bloodhound.cabal+2−2
@@ -1,5 +1,5 @@
1name: bloodhound
1name: bloodhound
2−version: 0.11.0.0
2+version: 0.11.1.0
3synopsis: ElasticSearch client library for Haskell
3synopsis: ElasticSearch client library for Haskell
4description: ElasticSearch made awesome for Haskell hackers
4description: ElasticSearch made awesome for Haskell hackers
5homepage: https://github.com/bitemyapp/bloodhound
5homepage: https://github.com/bitemyapp/bloodhound
@@ -33,7 +33,7 @@ library
33 bytestring >= 0.10.0 && <0.11,
33 bytestring >= 0.10.0 && <0.11,
34 containers >= 0.5.0.0 && <0.6,
34 containers >= 0.5.0.0 && <0.6,
35 aeson >= 0.11.1 && <0.12,
35 aeson >= 0.11.1 && <0.12,
36− http-client >= 0.3 && <0.5,
36+ http-client >= 0.5 && <0.6,
37 network-uri >= 2.6 && <2.7,
37 network-uri >= 2.6 && <2.7,
38 semigroups >= 0.15 && <0.19,
38 semigroups >= 0.15 && <0.19,
39 time >= 1.4 && <1.7,
39 time >= 1.4 && <1.7,
src/Database/Bloodhound/Client.hs+8−6
@@ -176,15 +176,17 @@ mkReplicaCount n
176emptyBody :: L.ByteString
176emptyBody :: L.ByteString
177emptyBody = L.pack ""
177emptyBody = L.pack ""
178
178
179−dispatch :: MonadBH m => Method -> Text -> Maybe L.ByteString
179+dispatch :: MonadBH m
180+ => Method
181+ -> Text
182+ -> Maybe L.ByteString
180− -> m Reply
183+ -> m Reply
181dispatch dMethod url body = do
184dispatch dMethod url body = do
182 initReq <- liftIO $ parseUrl' url
185 initReq <- liftIO $ parseUrl' url
183 reqHook <- bhRequestHook <$> getBHEnv
186 reqHook <- bhRequestHook <$> getBHEnv
184 let reqBody = RequestBodyLBS $ fromMaybe emptyBody body
187 let reqBody = RequestBodyLBS $ fromMaybe emptyBody body
185− req <- liftIO $ reqHook $ initReq { method = dMethod
188+ req <- liftIO $ reqHook $ setRequestIgnoreStatus $ initReq { method = dMethod
186− , requestBody = reqBody
189+ , requestBody = reqBody }
187− , checkStatus = \_ _ _ -> Nothing}
188 mgr <- bhManager <$> getBHEnv
190 mgr <- bhManager <$> getBHEnv
189 liftIO $ httpLbs req mgr
191 liftIO $ httpLbs req mgr
190
192
@@ -828,7 +830,7 @@ pageSearch :: From -- ^ The result offset
828pageSearch resultOffset pageSize search = search { from = resultOffset, size = pageSize }
830pageSearch resultOffset pageSize search = search { from = resultOffset, size = pageSize }
829
831
830parseUrl' :: MonadThrow m => Text -> m Request
832parseUrl' :: MonadThrow m => Text -> m Request
831−parseUrl' t = parseUrl (URI.escapeURIString URI.isAllowedInURI (T.unpack t))
833+parseUrl' t = parseRequest (URI.escapeURIString URI.isAllowedInURI (T.unpack t))
832
834
833-- | Was there an optimistic concurrency control conflict when
835-- | Was there an optimistic concurrency control conflict when
834-- indexing a document?
836-- indexing a document?
stack-7.10.yaml+2−1
@@ -2,10 +2,11 @@ flags: {}
2packages:
2packages:
3- '.'
3- '.'
4extra-deps:
4extra-deps:
5+# - http-client-0.4.24
6+- http-client-0.5.0
5- aeson-0.11.1.0
7- aeson-0.11.1.0
6- fail-4.9.0.0
8- fail-4.9.0.0
7- http-types-0.9
9- http-types-0.9
8−- http-client-0.4.24
9- attoparsec-0.13.0.1
10- attoparsec-0.13.0.1
10- doctest-0.10.1
11- doctest-0.10.1
11- doctest-prop-0.2.0.1
12- doctest-prop-0.2.0.1
tests/tests.hs+2−1
@@ -1154,6 +1154,7 @@ main = hspec $ do
1154 searchExpectAggs search
1154 searchExpectAggs search
1155 searchValidBucketAgg search "users" toTerms
1155 searchValidBucketAgg search "users" toTerms
1156
1156
1157+ -- One of these fails with 1.7.3
1157 it "can give execution hint parameters to term aggregations" $ when' (atmost es11) $ withTestEnv $ do
1158 it "can give execution hint parameters to term aggregations" $ when' (atmost es11) $ withTestEnv $ do
1158 _ <- insertData
1159 _ <- insertData
1159 searchTermsAggHint [Map, Ordinals]
1160 searchTermsAggHint [Map, Ordinals]
@@ -1165,7 +1166,7 @@ main = hspec $ do
1165 it "can give execution hint parameters to term aggregations" $ when' (atleast es12) $ withTestEnv $ do
1166 it "can give execution hint parameters to term aggregations" $ when' (atleast es12) $ withTestEnv $ do
1166 _ <- insertData
1167 _ <- insertData
1167 searchTermsAggHint [GlobalOrdinals, GlobalOrdinalsHash, GlobalOrdinalsLowCardinality, Map]
1168 searchTermsAggHint [GlobalOrdinals, GlobalOrdinalsHash, GlobalOrdinalsLowCardinality, Map]
1168−
1169+ -- One of the above.
1169
1170
1170 it "can execute value_count aggregations" $ withTestEnv $ do
1171 it "can execute value_count aggregations" $ withTestEnv $ do
1171 _ <- insertData
1172 _ <- insertData