git.iko.soy/typeable/bloodhound
on master help sign in
add support for lts-13.21
commita434382b15f429d5749caf81413bbc26379f12b1 authorDmitry Olshansky <olshanskydr@gmail.com> dateTue 13 Apr 2021, 19:17 (6 years ago) parent41d890d
7 files changed+39−14
src/Database/V1/Bloodhound/Internal/Client.hs+5 src/Database/V1/Bloodhound/Internal/Query.hs+7 src/Database/V5/Bloodhound/Client.hs+12−12 src/Database/V5/Bloodhound/Internal/Client.hs+7 src/Database/V5/Bloodhound/Internal/Query.hs+6 stack-8.10.yaml+1−1 stack.yaml+1−1
src/Database/V1/Bloodhound/Internal/Client.hs+5
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE FlexibleInstances #-}
23{-# LANGUAGE GeneralizedNewtypeDeriving #-}
34{-# LANGUAGE MultiParamTypeClasses #-}
@@ -26,6 +27,10 @@ import Database.V1.Bloodhound.Internal.Newtypes
2627import Database.V1.Bloodhound.Internal.Query
2728import Database.V1.Bloodhound.Internal.StringlyTyped
2829
30+#if !MIN_VERSION_base(4,13,0)
31+import Control.Monad.Fail
32+import Prelude hiding (fail)
33+#endif
2934
3035{-| Common environment for Elasticsearch calls. Connections will be
3136 pipelined according to the provided HTTP connection manager.
src/Database/V1/Bloodhound/Internal/Query.hs+7
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
23{-# LANGUAGE OverloadedStrings #-}
34{-# LANGUAGE RecordWildCards #-}
@@ -13,6 +14,12 @@ import qualified Data.Text as T
1314import Database.V1.Bloodhound.Internal.Newtypes
1415import Database.V1.Bloodhound.Types.Class
1516
17+#if !MIN_VERSION_base(4,13,0)
18+import Control.Monad.Fail
19+import Prelude hiding (fail)
20+#endif
21+
22+
1623
1724data GeoPoint =
1825 GeoPoint { geoField :: FieldName
src/Database/V5/Bloodhound/Client.hs+12−12
@@ -523,13 +523,13 @@ createIndex indexSettings (IndexName indexName) =
523523createIndexWith :: MonadBH m
524524 => [UpdatableIndexSetting]
525525 -> Int -- ^ shard count
526− -> IndexName
526+ -> IndexName
527527 -> m Reply
528528createIndexWith updates shards (IndexName indexName) =
529529 bindM2 put url (return (Just body))
530530 where url = joinPath [indexName]
531531 body = encode $ object
532− ["settings" .= deepMerge
532+ ["settings" .= deepMerge
533533 ( HM.singleton "index.number_of_shards" (toJSON shards) :
534534 [u | Object u <- toJSON <$> updates]
535535 )
@@ -575,8 +575,8 @@ getIndexSettings (IndexName indexName) =
575575 where
576576 url = joinPath [indexName, "_settings"]
577577
578−-- | 'forceMergeIndex'
579−--
578+-- | 'forceMergeIndex'
579+--
580580-- The force merge API allows to force merging of one or more indices through
581581-- an API. The merge relates to the number of segments a Lucene index holds
582582-- within each shard. The force merge operation allows to reduce the number of
@@ -1035,10 +1035,10 @@ searchByType (IndexName indexName)
10351035-- search results. Note that the search is put into 'SearchTypeScan'
10361036-- mode and thus results will not be sorted. Combine this with
10371037-- 'advanceScroll' to efficiently stream through the full result set
1038−getInitialScroll ::
1039− (FromJSON a, MonadThrow m, MonadBH m) => IndexName ->
1040− MappingName ->
1041− Search ->
1038+getInitialScroll ::
1039+ (FromJSON a, MonadThrow m, MonadBH m) => IndexName ->
1040+ MappingName ->
1041+ Search ->
10421042 m (Either EsError (SearchResult a))
10431043getInitialScroll (IndexName indexName) (MappingName mappingName) search' = do
10441044 let url = addQuery params <$> joinPath [indexName, mappingName, "_search"]
@@ -1063,7 +1063,7 @@ getInitialSortedScroll (IndexName indexName) (MappingName mappingName) search =
10631063 resp' <- bindM2 dispatchSearch url (return search)
10641064 parseEsResponse resp'
10651065
1066−scroll' :: (FromJSON a, MonadBH m, MonadThrow m) => Maybe ScrollId ->
1066+scroll' :: (FromJSON a, MonadBH m, MonadThrow m) => Maybe ScrollId ->
10671067 m ([Hit a], Maybe ScrollId)
10681068scroll' Nothing = return ([], Nothing)
10691069scroll' (Just sid) = do
@@ -1090,13 +1090,13 @@ advanceScroll (ScrollId sid) scroll = do
10901090 where scrollTime = showText secs <> "s"
10911091 secs :: Integer
10921092 secs = round scroll
1093−
1093+
10941094 scrollObject = object [ "scroll" .= scrollTime
10951095 , "scroll_id" .= sid
10961096 ]
10971097
1098−simpleAccumulator ::
1099− (FromJSON a, MonadBH m, MonadThrow m) =>
1098+simpleAccumulator ::
1099+ (FromJSON a, MonadBH m, MonadThrow m) =>
11001100 [Hit a] ->
11011101 ([Hit a], Maybe ScrollId) ->
11021102 m ([Hit a], Maybe ScrollId)
src/Database/V5/Bloodhound/Internal/Client.hs+7
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE FlexibleInstances #-}
23{-# LANGUAGE GeneralizedNewtypeDeriving #-}
34{-# LANGUAGE MultiParamTypeClasses #-}
@@ -24,6 +25,12 @@ import Database.V5.Bloodhound.Internal.Newtypes
2425import Database.V5.Bloodhound.Internal.Query
2526import Database.V5.Bloodhound.Internal.StringlyTyped
2627
28+#if !MIN_VERSION_base(4,13,0)
29+import Control.Monad.Fail
30+import Prelude hiding (fail)
31+#endif
32+
33+
2734{-| Common environment for Elasticsearch calls. Connections will be
2835 pipelined according to the provided HTTP connection manager.
2936-}
src/Database/V5/Bloodhound/Internal/Query.hs+6
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE GeneralizedNewtypeDeriving #-}
23{-# LANGUAGE OverloadedStrings #-}
34{-# LANGUAGE RecordWildCards #-}
@@ -17,6 +18,11 @@ import qualified Data.Text as T
1718import Database.Bloodhound.Common.Script as X
1819import Database.V5.Bloodhound.Internal.Newtypes
1920
21+#if !MIN_VERSION_base(4,13,0)
22+import Control.Monad.Fail
23+import Prelude hiding (fail)
24+#endif
25+
2026data Query =
2127 TermQuery Term (Maybe Boost)
2228 | TermsQuery Text (NonEmpty Text)
stack-8.10.yaml+1−1
@@ -13,4 +13,4 @@ extra-deps:
1313resolver: lts-17.9
1414
1515nix:
16− packages: [zlib]
16+ packages: [zlib]
stack.yaml+1−1
@@ -1 +1 @@
1−stack-8.2.yaml
1+stack-8.10.yaml