git.iko.soy/typeable/bloodhound
on master help sign in
http-client-0.5.0 support
commit0403b19a44093054f33560747780aa7724180273 authorChris Allen <cma@bitemyapp.com> dateWed 6 Jul 2016, 15:33 (10 years ago) parente4ff3e4
5 files changed+19−28
Makefile+5−18 bloodhound.cabal+2−2 src/Database/Bloodhound/Client.hs+8−6 stack-7.10.yaml+2−1 tests/tests.hs+2−1
Makefile+5−18
@@ -1,22 +1,9 @@
1−install-with-test-support:
2− cabal install --enable-tests
3− echo "Make certain you have an elasticsearch instance on localhost:9200 !"
4− cabal test
1+build:
2+ stack build
53
64test:
75 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:
15− cabal repl tests
16−
17−repl:
18− cabal repl
6+ stack test
197
20−reset:
21− rm -rf .cabal-sandbox
22− cabal sandbox init
8+ghci:
9+ stack ghci
bloodhound.cabal+2−2
@@ -1,5 +1,5 @@
11name: bloodhound
2−version: 0.11.0.0
2+version: 0.11.1.0
33synopsis: ElasticSearch client library for Haskell
44description: ElasticSearch made awesome for Haskell hackers
55homepage: https://github.com/bitemyapp/bloodhound
@@ -33,7 +33,7 @@ library
3333 bytestring >= 0.10.0 && <0.11,
3434 containers >= 0.5.0.0 && <0.6,
3535 aeson >= 0.11.1 && <0.12,
36− http-client >= 0.3 && <0.5,
36+ http-client >= 0.5 && <0.6,
3737 network-uri >= 2.6 && <2.7,
3838 semigroups >= 0.15 && <0.19,
3939 time >= 1.4 && <1.7,
src/Database/Bloodhound/Client.hs+8−6
@@ -176,15 +176,17 @@ mkReplicaCount n
176176emptyBody :: L.ByteString
177177emptyBody = L.pack ""
178178
179−dispatch :: MonadBH m => Method -> Text -> Maybe L.ByteString
180− -> m Reply
179+dispatch :: MonadBH m
180+ => Method
181+ -> Text
182+ -> Maybe L.ByteString
183+ -> m Reply
181184dispatch dMethod url body = do
182185 initReq <- liftIO $ parseUrl' url
183186 reqHook <- bhRequestHook <$> getBHEnv
184187 let reqBody = RequestBodyLBS $ fromMaybe emptyBody body
185− req <- liftIO $ reqHook $ initReq { method = dMethod
186− , requestBody = reqBody
187− , checkStatus = \_ _ _ -> Nothing}
188+ req <- liftIO $ reqHook $ setRequestIgnoreStatus $ initReq { method = dMethod
189+ , requestBody = reqBody }
188190 mgr <- bhManager <$> getBHEnv
189191 liftIO $ httpLbs req mgr
190192
@@ -828,7 +830,7 @@ pageSearch :: From -- ^ The result offset
828830pageSearch resultOffset pageSize search = search { from = resultOffset, size = pageSize }
829831
830832parseUrl' :: 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))
832834
833835-- | Was there an optimistic concurrency control conflict when
834836-- indexing a document?
stack-7.10.yaml+2−1
@@ -2,10 +2,11 @@ flags: {}
22packages:
33- '.'
44extra-deps:
5+# - http-client-0.4.24
6+- http-client-0.5.0
57- aeson-0.11.1.0
68- fail-4.9.0.0
79- http-types-0.9
8−- http-client-0.4.24
910- attoparsec-0.13.0.1
1011- doctest-0.10.1
1112- doctest-prop-0.2.0.1
tests/tests.hs+2−1
@@ -1154,6 +1154,7 @@ main = hspec $ do
11541154 searchExpectAggs search
11551155 searchValidBucketAgg search "users" toTerms
11561156
1157+ -- One of these fails with 1.7.3
11571158 it "can give execution hint parameters to term aggregations" $ when' (atmost es11) $ withTestEnv $ do
11581159 _ <- insertData
11591160 searchTermsAggHint [Map, Ordinals]
@@ -1165,7 +1166,7 @@ main = hspec $ do
11651166 it "can give execution hint parameters to term aggregations" $ when' (atleast es12) $ withTestEnv $ do
11661167 _ <- insertData
11671168 searchTermsAggHint [GlobalOrdinals, GlobalOrdinalsHash, GlobalOrdinalsLowCardinality, Map]
1168−
1169+ -- One of the above.
11691170
11701171 it "can execute value_count aggregations" $ withTestEnv $ do
11711172 _ <- insertData