git.iko.soy/typeable/bloodhound
on master help sign in
add support for lts-13.21
a434382Dmitry Olshansky
src/Database/V1/Bloodhound/Internal/Client.hs+5
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
@@ -26,6 +27,10 @@ import Database.V1.Bloodhound.Internal.Newtypes
26import Database.V1.Bloodhound.Internal.Query
27import Database.V1.Bloodhound.Internal.Query
27import Database.V1.Bloodhound.Internal.StringlyTyped
28import Database.V1.Bloodhound.Internal.StringlyTyped
28
29
30+#if !MIN_VERSION_base(4,13,0)
31+import Control.Monad.Fail
32+import Prelude hiding (fail)
33+#endif
29
34
30{-| Common environment for Elasticsearch calls. Connections will be
35{-| Common environment for Elasticsearch calls. Connections will be
31 pipelined according to the provided HTTP connection manager.
36 pipelined according to the provided HTTP connection manager.
src/Database/V1/Bloodhound/Internal/Query.hs+7
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE RecordWildCards #-}
4{-# LANGUAGE RecordWildCards #-}
@@ -13,6 +14,12 @@ import qualified Data.Text as T
13import Database.V1.Bloodhound.Internal.Newtypes
14import Database.V1.Bloodhound.Internal.Newtypes
14import Database.V1.Bloodhound.Types.Class
15import Database.V1.Bloodhound.Types.Class
15
16
17+#if !MIN_VERSION_base(4,13,0)
18+import Control.Monad.Fail
19+import Prelude hiding (fail)
20+#endif
21+
22+
16
23
17data GeoPoint =
24data GeoPoint =
18 GeoPoint { geoField :: FieldName
25 GeoPoint { geoField :: FieldName
src/Database/V5/Bloodhound/Client.hs+12−12
@@ -523,13 +523,13 @@ createIndex indexSettings (IndexName indexName) =
523createIndexWith :: MonadBH m
523createIndexWith :: MonadBH m
524 => [UpdatableIndexSetting]
524 => [UpdatableIndexSetting]
525 -> Int -- ^ shard count
525 -> Int -- ^ shard count
526− -> IndexName
526+ -> IndexName
527 -> m Reply
527 -> m Reply
528createIndexWith updates shards (IndexName indexName) =
528createIndexWith updates shards (IndexName indexName) =
529 bindM2 put url (return (Just body))
529 bindM2 put url (return (Just body))
530 where url = joinPath [indexName]
530 where url = joinPath [indexName]
531 body = encode $ object
531 body = encode $ object
532− ["settings" .= deepMerge
532+ ["settings" .= deepMerge
533 ( HM.singleton "index.number_of_shards" (toJSON shards) :
533 ( HM.singleton "index.number_of_shards" (toJSON shards) :
534 [u | Object u <- toJSON <$> updates]
534 [u | Object u <- toJSON <$> updates]
535 )
535 )
@@ -575,8 +575,8 @@ getIndexSettings (IndexName indexName) =
575 where
575 where
576 url = joinPath [indexName, "_settings"]
576 url = joinPath [indexName, "_settings"]
577
577
578−-- | 'forceMergeIndex'
578+-- | 'forceMergeIndex'
579−--
579+--
580-- The force merge API allows to force merging of one or more indices through
580-- The force merge API allows to force merging of one or more indices through
581-- an API. The merge relates to the number of segments a Lucene index holds
581-- an API. The merge relates to the number of segments a Lucene index holds
582-- within each shard. The force merge operation allows to reduce the number of
582-- within each shard. The force merge operation allows to reduce the number of
@@ -1035,10 +1035,10 @@ searchByType (IndexName indexName)
1035-- search results. Note that the search is put into 'SearchTypeScan'
1035-- search results. Note that the search is put into 'SearchTypeScan'
1036-- mode and thus results will not be sorted. Combine this with
1036-- mode and thus results will not be sorted. Combine this with
1037-- 'advanceScroll' to efficiently stream through the full result set
1037-- 'advanceScroll' to efficiently stream through the full result set
1038−getInitialScroll ::
1038+getInitialScroll ::
1039− (FromJSON a, MonadThrow m, MonadBH m) => IndexName ->
1039+ (FromJSON a, MonadThrow m, MonadBH m) => IndexName ->
1040− MappingName ->
1040+ MappingName ->
1041− Search ->
1041+ Search ->
1042 m (Either EsError (SearchResult a))
1042 m (Either EsError (SearchResult a))
1043getInitialScroll (IndexName indexName) (MappingName mappingName) search' = do
1043getInitialScroll (IndexName indexName) (MappingName mappingName) search' = do
1044 let url = addQuery params <$> joinPath [indexName, mappingName, "_search"]
1044 let url = addQuery params <$> joinPath [indexName, mappingName, "_search"]
@@ -1063,7 +1063,7 @@ getInitialSortedScroll (IndexName indexName) (MappingName mappingName) search =
1063 resp' <- bindM2 dispatchSearch url (return search)
1063 resp' <- bindM2 dispatchSearch url (return search)
1064 parseEsResponse resp'
1064 parseEsResponse resp'
1065
1065
1066−scroll' :: (FromJSON a, MonadBH m, MonadThrow m) => Maybe ScrollId ->
1066+scroll' :: (FromJSON a, MonadBH m, MonadThrow m) => Maybe ScrollId ->
1067 m ([Hit a], Maybe ScrollId)
1067 m ([Hit a], Maybe ScrollId)
1068scroll' Nothing = return ([], Nothing)
1068scroll' Nothing = return ([], Nothing)
1069scroll' (Just sid) = do
1069scroll' (Just sid) = do
@@ -1090,13 +1090,13 @@ advanceScroll (ScrollId sid) scroll = do
1090 where scrollTime = showText secs <> "s"
1090 where scrollTime = showText secs <> "s"
1091 secs :: Integer
1091 secs :: Integer
1092 secs = round scroll
1092 secs = round scroll
1093−
1093+
1094 scrollObject = object [ "scroll" .= scrollTime
1094 scrollObject = object [ "scroll" .= scrollTime
1095 , "scroll_id" .= sid
1095 , "scroll_id" .= sid
1096 ]
1096 ]
1097
1097
1098−simpleAccumulator ::
1098+simpleAccumulator ::
1099− (FromJSON a, MonadBH m, MonadThrow m) =>
1099+ (FromJSON a, MonadBH m, MonadThrow m) =>
1100 [Hit a] ->
1100 [Hit a] ->
1101 ([Hit a], Maybe ScrollId) ->
1101 ([Hit a], Maybe ScrollId) ->
1102 m ([Hit a], Maybe ScrollId)
1102 m ([Hit a], Maybe ScrollId)
src/Database/V5/Bloodhound/Internal/Client.hs+7
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
@@ -24,6 +25,12 @@ import Database.V5.Bloodhound.Internal.Newtypes
24import Database.V5.Bloodhound.Internal.Query
25import Database.V5.Bloodhound.Internal.Query
25import Database.V5.Bloodhound.Internal.StringlyTyped
26import Database.V5.Bloodhound.Internal.StringlyTyped
26
27
28+#if !MIN_VERSION_base(4,13,0)
29+import Control.Monad.Fail
30+import Prelude hiding (fail)
31+#endif
32+
33+
27{-| Common environment for Elasticsearch calls. Connections will be
34{-| Common environment for Elasticsearch calls. Connections will be
28 pipelined according to the provided HTTP connection manager.
35 pipelined according to the provided HTTP connection manager.
29-}
36-}
src/Database/V5/Bloodhound/Internal/Query.hs+6
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
1{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE GeneralizedNewtypeDeriving #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE RecordWildCards #-}
4{-# LANGUAGE RecordWildCards #-}
@@ -17,6 +18,11 @@ import qualified Data.Text as T
17import Database.Bloodhound.Common.Script as X
18import Database.Bloodhound.Common.Script as X
18import Database.V5.Bloodhound.Internal.Newtypes
19import Database.V5.Bloodhound.Internal.Newtypes
19
20
21+#if !MIN_VERSION_base(4,13,0)
22+import Control.Monad.Fail
23+import Prelude hiding (fail)
24+#endif
25+
20data Query =
26data Query =
21 TermQuery Term (Maybe Boost)
27 TermQuery Term (Maybe Boost)
22 | TermsQuery Text (NonEmpty Text)
28 | TermsQuery Text (NonEmpty Text)
stack-8.10.yaml+1−1
@@ -13,4 +13,4 @@ extra-deps:
13resolver: lts-17.9
13resolver: lts-17.9
14
14
15nix:
15nix:
16− packages: [zlib]
16+ packages: [zlib]
stack.yaml+1−1
@@ -1 +1 @@
1−stack-8.2.yaml
1+stack-8.10.yaml