@@ -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)
@@ -1134,9 +1134,9 @@ scanSearch indexName mappingName search = do
11341134--
11351135-- >>> let query = TermQuery (Term "user" "bitemyapp") Nothing
11361136-- >>> mkSearch (Just query) Nothing
1137−-- Search {queryBody = Just (TermQuery (Term {termField = "user", termValue = "bitemyapp"}) Nothing), filterBody = Nothing, sortBody = Nothing, aggBody = Nothing, highlight = Nothing, trackSortScores = False, from = From 0, size = Size 10, searchType = SearchTypeQueryThenFetch, fields = Nothing, source = Nothing}
1137+-- Search {queryBody = Just (TermQuery (Term {termField = "user", termValue = "bitemyapp"}) Nothing), filterBody = Nothing, searchAfterKey = Nothing, sortBody = Nothing, aggBody = Nothing, highlight = Nothing, trackSortScores = False, from = From 0, size = Size 10, searchType = SearchTypeQueryThenFetch, fields = Nothing, source = Nothing}
11381138mkSearch :: Maybe Query -> Maybe Filter -> Search
1139−mkSearch query filter = Search query filter Nothing Nothing Nothing False (From 0) (Size 10) SearchTypeQueryThenFetch Nothing Nothing Nothing Nothing
1139+mkSearch query filter = Search query filter Nothing Nothing Nothing False (From 0) (Size 10) SearchTypeQueryThenFetch Nothing Nothing Nothing Nothing Nothing
11401140
11411141-- | 'mkAggregateSearch' is a helper function that defaults everything in a 'Search' except for
11421142-- the 'Query' and the 'Aggregation'.
@@ -1146,7 +1146,7 @@ mkSearch query filter = Search query filter Nothing Nothing Nothing False (From
11461146-- TermsAgg (TermsAggregation {term = Left "user", termInclude = Nothing, termExclude = Nothing, termOrder = Nothing, termMinDocCount = Nothing, termSize = Nothing, termShardSize = Nothing, termCollectMode = Just BreadthFirst, termExecutionHint = Nothing, termAggs = Nothing})
11471147-- >>> let myAggregation = mkAggregateSearch Nothing $ mkAggregations "users" terms
11481148mkAggregateSearch :: Maybe Query -> Aggregations -> Search
1149−mkAggregateSearch query mkSearchAggs = Search query Nothing Nothing (Just mkSearchAggs) Nothing False (From 0) (Size 0) SearchTypeQueryThenFetch Nothing Nothing Nothing Nothing
1149+mkAggregateSearch query mkSearchAggs = Search query Nothing Nothing (Just mkSearchAggs) Nothing False (From 0) (Size 0) SearchTypeQueryThenFetch Nothing Nothing Nothing Nothing Nothing
11501150
11511151-- | 'mkHighlightSearch' is a helper function that defaults everything in a 'Search' except for
11521152-- the 'Query' and the 'Aggregation'.
@@ -1155,7 +1155,7 @@ mkAggregateSearch query mkSearchAggs = Search query Nothing Nothing (Just mkSear
11551155-- >>> let testHighlight = Highlights Nothing [FieldHighlight (FieldName "message") Nothing]
11561156-- >>> let search = mkHighlightSearch (Just query) testHighlight
11571157mkHighlightSearch :: Maybe Query -> Highlights -> Search
1158−mkHighlightSearch query searchHighlights = Search query Nothing Nothing Nothing (Just searchHighlights) False (From 0) (Size 10) SearchTypeQueryThenFetch Nothing Nothing Nothing Nothing
1158+mkHighlightSearch query searchHighlights = Search query Nothing Nothing Nothing (Just searchHighlights) False (From 0) (Size 10) SearchTypeQueryThenFetch Nothing Nothing Nothing Nothing Nothing
11591159
11601160-- | 'pageSearch' is a helper function that takes a search and assigns the from
11611161-- and size fields for the search. The from parameter defines the offset