@@ -230,6 +230,7 @@ module Database.Bloodhound.Types
232import Control.Applicative
232import Control.Applicative
233+import Control.Monad.Catch
233import Control.Monad.Error
234import Control.Monad.Error
234import Control.Monad.Reader
235import Control.Monad.Reader
235import Control.Monad.State
236import Control.Monad.State
@@ -237,9 +238,9 @@ import Control.Monad.Writer
237import Data.Aeson
238import Data.Aeson
238import Data.Aeson.Types (Pair, emptyObject, parseMaybe)
239import Data.Aeson.Types (Pair, emptyObject, parseMaybe)
239import qualified Data.ByteString.Lazy.Char8 as L
240import qualified Data.ByteString.Lazy.Char8 as L
240−import Data.List (nub, foldl')
241−import Data.List.NonEmpty (NonEmpty (..), toList)
242import qualified Data.HashMap.Strict as HM (union)
241import qualified Data.HashMap.Strict as HM (union)
242+import Data.List (foldl', nub)
243+import Data.List.NonEmpty (NonEmpty (..), toList)
243import qualified Data.Map.Strict as M
244import qualified Data.Map.Strict as M
244import Data.Maybe
245import Data.Maybe
245import Data.Text (Text)
246import Data.Text (Text)
@@ -290,7 +291,10 @@ newtype BH m a = BH {
290 , MonadError e
291 , MonadError e
291 , Alternative
292 , Alternative
292 , MonadPlus
293 , MonadPlus
293− , MonadFix)
294+ , MonadFix
295instance MonadTrans BH where
299instance MonadTrans BH where
296 lift = BH . lift
300 lift = BH . lift
@@ -373,7 +377,7 @@ data FieldDefinition =
373 https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html
377 https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html
375data IndexTemplate =
379data IndexTemplate =
376− IndexTemplate { templatePattern :: TemplatePattern
380+ IndexTemplate { templatePattern :: TemplatePattern
377 , templateSettings :: Maybe IndexSettings
381 , templateSettings :: Maybe IndexSettings
378 , templateMappings :: [Value]
382 , templateMappings :: [Value]
@@ -407,9 +411,9 @@ data BulkOperation =
407{-| 'EsResult' describes the standard wrapper JSON document that you see in
411{-| 'EsResult' describes the standard wrapper JSON document that you see in
408 successful Elasticsearch lookups or lookups that couldn't find the document.
412 successful Elasticsearch lookups or lookups that couldn't find the document.
410−data EsResult a = EsResult { _index :: Text
414+data EsResult a = EsResult { _index :: Text
411− , _type :: Text
415+ , _type :: Text
412− , _id :: Text
416+ , _id :: Text
413 , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Show)
417 , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Show)
@@ -417,7 +421,7 @@ data EsResult a = EsResult { _index :: Text
417 'EsResult' when the document was successfully found.
421 'EsResult' when the document was successfully found.
419data EsResultFound a = EsResultFound { _version :: DocVersion
423data EsResultFound a = EsResultFound { _version :: DocVersion
420− , _source :: a } deriving (Eq, Show)
424+ , _source :: a } deriving (Eq, Show)
@@ -1388,7 +1392,7 @@ data ValueCountAggregation = FieldValueCount FieldName
1389-- | Single-bucket filter aggregations. See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html#search-aggregations-bucket-filter-aggregation> for more information.
1393-- | Single-bucket filter aggregations. See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html#search-aggregations-bucket-filter-aggregation> for more information.
1390data FilterAggregation = FilterAggregation { faFilter :: Filter
1394data FilterAggregation = FilterAggregation { faFilter :: Filter
1391− , faAggs :: Maybe Aggregations} deriving (Eq, Show)
1395+ , faAggs :: Maybe Aggregations} deriving (Eq, Show)
1393mkTermsAggregation :: Text -> TermsAggregation
1397mkTermsAggregation :: Text -> TermsAggregation
1394mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
1398mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing