@@ -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]
@@ -575,8 +575,8 @@ getIndexSettings (IndexName indexName) =
576 url = joinPath [indexName, "_settings"]
576 url = joinPath [indexName, "_settings"]
578−-- | 'forceMergeIndex'
578+-- | 'forceMergeIndex'
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'
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
1094 scrollObject = object [ "scroll" .= scrollTime
1094 scrollObject = object [ "scroll" .= scrollTime
1095 , "scroll_id" .= sid
1095 , "scroll_id" .= sid
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)