git.iko.soy/typeable/bloodhound
on master help sign in
add missing Typeables
5395a0bMichael Xavier
src/Database/Bloodhound/Types.hs+80−80
@@ -378,7 +378,7 @@ data Status = Status { ok :: Maybe Bool
378
378
379data IndexSettings =
379data IndexSettings =
380 IndexSettings { indexShards :: ShardCount
380 IndexSettings { indexShards :: ShardCount
381− , indexReplicas :: ReplicaCount } deriving (Eq, Show, Generic)
381+ , indexReplicas :: ReplicaCount } deriving (Eq, Show, Generic, Typeable)
382
382
383{-| 'defaultIndexSettings' is an 'IndexSettings' with 3 shards and 2 replicas. -}
383{-| 'defaultIndexSettings' is an 'IndexSettings' with 3 shards and 2 replicas. -}
384defaultIndexSettings :: IndexSettings
384defaultIndexSettings :: IndexSettings
@@ -436,7 +436,7 @@ data UpdatableIndexSetting = NumberOfReplicas ReplicaCount
436 | IndexCompoundFormat CompoundFormat
436 | IndexCompoundFormat CompoundFormat
437 | IndexCompoundOnFlush Bool
437 | IndexCompoundOnFlush Bool
438 | WarmerEnabled Bool
438 | WarmerEnabled Bool
439− deriving (Eq, Show, Generic)
439+ deriving (Eq, Show, Generic, Typeable)
440
440
441data AllocationPolicy = AllocAll
441data AllocationPolicy = AllocAll
442 -- ^ Allows shard allocation for all shards.
442 -- ^ Allows shard allocation for all shards.
@@ -446,42 +446,42 @@ data AllocationPolicy = AllocAll
446 -- ^ Allows shard allocation only for primary shards for new indices.
446 -- ^ Allows shard allocation only for primary shards for new indices.
447 | AllocNone
447 | AllocNone
448 -- ^ No shard allocation is allowed
448 -- ^ No shard allocation is allowed
449− deriving (Eq, Show, Generic)
449+ deriving (Eq, Show, Generic, Typeable)
450
450
451data ReplicaBounds = ReplicasBounded Int Int
451data ReplicaBounds = ReplicasBounded Int Int
452 | ReplicasLowerBounded Int
452 | ReplicasLowerBounded Int
453 | ReplicasUnbounded
453 | ReplicasUnbounded
454− deriving (Eq, Show, Generic)
454+ deriving (Eq, Show, Generic, Typeable)
455
455
456−newtype Bytes = Bytes Int deriving (Eq, Show, Generic, Ord, ToJSON, FromJSON)
456+newtype Bytes = Bytes Int deriving (Eq, Show, Generic, Typeable, Ord, ToJSON, FromJSON)
457
457
458data FSType = FSSimple
458data FSType = FSSimple
459− | FSBuffered deriving (Eq, Show, Generic, Ord)
459+ | FSBuffered deriving (Eq, Show, Generic, Typeable, Ord)
460
460
461data InitialShardCount = QuorumShards
461data InitialShardCount = QuorumShards
462 | QuorumMinus1Shards
462 | QuorumMinus1Shards
463 | FullShards
463 | FullShards
464 | FullMinus1Shards
464 | FullMinus1Shards
465 | ExplicitShards Int
465 | ExplicitShards Int
466− deriving (Eq, Show, Generic)
466+ deriving (Eq, Show, Generic, Typeable)
467
467
468data NodeAttrFilter = NodeAttrFilter { nodeAttrFilterName :: NodeAttrName
468data NodeAttrFilter = NodeAttrFilter { nodeAttrFilterName :: NodeAttrName
469 , nodeAttrFilterValues :: NonEmpty Text}
469 , nodeAttrFilterValues :: NonEmpty Text}
470 deriving (Eq, Show, Generic, Ord)
470 deriving (Eq, Show, Generic, Ord)
471
471
472−newtype NodeAttrName = NodeAttrName Text deriving (Eq, Show, Ord, Generic)
472+newtype NodeAttrName = NodeAttrName Text deriving (Eq, Show, Ord, Generic, Typeable)
473
473
474data CompoundFormat = CompoundFileFormat Bool
474data CompoundFormat = CompoundFileFormat Bool
475 | MergeSegmentVsTotalIndex Double
475 | MergeSegmentVsTotalIndex Double
476 -- ^ percentage between 0 and 1 where 0 is false, 1 is true
476 -- ^ percentage between 0 and 1 where 0 is false, 1 is true
477− deriving (Eq, Show, Generic)
477+ deriving (Eq, Show, Generic, Typeable)
478
478
479newtype NominalDiffTimeJSON = NominalDiffTimeJSON { ndtJSON :: NominalDiffTime }
479newtype NominalDiffTimeJSON = NominalDiffTimeJSON { ndtJSON :: NominalDiffTime }
480
480
481data IndexSettingsSummary = IndexSettingsSummary { sSummaryIndexName :: IndexName
481data IndexSettingsSummary = IndexSettingsSummary { sSummaryIndexName :: IndexName
482 , sSummaryFixedSettings :: IndexSettings
482 , sSummaryFixedSettings :: IndexSettings
483 , sSummaryUpdateable :: [UpdatableIndexSetting]}
483 , sSummaryUpdateable :: [UpdatableIndexSetting]}
484− deriving (Eq, Show, Generic)
484+ deriving (Eq, Show, Generic, Typeable)
485
485
486{-| 'Reply' and 'Method' are type synonyms from 'Network.HTTP.Types.Method.Method' -}
486{-| 'Reply' and 'Method' are type synonyms from 'Network.HTTP.Types.Method.Method' -}
487type Reply = Network.HTTP.Client.Response L.ByteString
487type Reply = Network.HTTP.Client.Response L.ByteString
@@ -491,7 +491,7 @@ type Method = NHTM.Method
491
491
492 <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html>
492 <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html>
493-}
493-}
494−data OpenCloseIndex = OpenIndex | CloseIndex deriving (Eq, Show, Generic)
494+data OpenCloseIndex = OpenIndex | CloseIndex deriving (Eq, Show, Generic, Typeable)
495
495
496data FieldType = GeoPointType
496data FieldType = GeoPointType
497 | GeoShapeType
497 | GeoShapeType
@@ -499,10 +499,10 @@ data FieldType = GeoPointType
499 | IntegerType
499 | IntegerType
500 | LongType
500 | LongType
501 | ShortType
501 | ShortType
502− | ByteType deriving (Eq, Show, Generic)
502+ | ByteType deriving (Eq, Show, Generic, Typeable)
503
503
504data FieldDefinition =
504data FieldDefinition =
505− FieldDefinition { fieldType :: FieldType } deriving (Eq, Show, Generic)
505+ FieldDefinition { fieldType :: FieldType } deriving (Eq, Show, Generic, Typeable)
506
506
507{-| An 'IndexTemplate' defines a template that will automatically be
507{-| An 'IndexTemplate' defines a template that will automatically be
508 applied to new indices created. The templates include both
508 applied to new indices created. The templates include both
@@ -520,7 +520,7 @@ data IndexTemplate =
520
520
521data MappingField =
521data MappingField =
522 MappingField { mappingFieldName :: FieldName
522 MappingField { mappingFieldName :: FieldName
523− , fieldDefinition :: FieldDefinition } deriving (Eq, Show, Generic)
523+ , fieldDefinition :: FieldDefinition } deriving (Eq, Show, Generic, Typeable)
524
524
525{-| Support for type reification of 'Mapping's is currently incomplete, for
525{-| Support for type reification of 'Mapping's is currently incomplete, for
526 now the mapping API verbiage expects a 'ToJSON'able blob.
526 now the mapping API verbiage expects a 'ToJSON'able blob.
@@ -530,7 +530,7 @@ data MappingField =
530 and keeping different kinds of documents separated if possible.
530 and keeping different kinds of documents separated if possible.
531-}
531-}
532data Mapping = Mapping { typeName :: TypeName
532data Mapping = Mapping { typeName :: TypeName
533− , mappingFields :: [MappingField] } deriving (Eq, Show, Generic)
533+ , mappingFields :: [MappingField] } deriving (Eq, Show, Generic, Typeable)
534
534
535{-| 'BulkOperation' is a sum type for expressing the four kinds of bulk
535{-| 'BulkOperation' is a sum type for expressing the four kinds of bulk
536 operation index, create, delete, and update. 'BulkIndex' behaves like an
536 operation index, create, delete, and update. 'BulkIndex' behaves like an
@@ -542,7 +542,7 @@ data BulkOperation =
542 BulkIndex IndexName MappingName DocId Value
542 BulkIndex IndexName MappingName DocId Value
543 | BulkCreate IndexName MappingName DocId Value
543 | BulkCreate IndexName MappingName DocId Value
544 | BulkDelete IndexName MappingName DocId
544 | BulkDelete IndexName MappingName DocId
545− | BulkUpdate IndexName MappingName DocId Value deriving (Eq, Show, Generic)
545+ | BulkUpdate IndexName MappingName DocId Value deriving (Eq, Show, Generic, Typeable)
546
546
547{-| 'EsResult' describes the standard wrapper JSON document that you see in
547{-| 'EsResult' describes the standard wrapper JSON document that you see in
548 successful Elasticsearch lookups or lookups that couldn't find the document.
548 successful Elasticsearch lookups or lookups that couldn't find the document.
@@ -550,23 +550,23 @@ data BulkOperation =
550data EsResult a = EsResult { _index :: Text
550data EsResult a = EsResult { _index :: Text
551 , _type :: Text
551 , _type :: Text
552 , _id :: Text
552 , _id :: Text
553− , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Show, Generic)
553+ , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Show, Generic, Typeable)
554
554
555{-| 'EsResultFound' contains the document and its metadata inside of an
555{-| 'EsResultFound' contains the document and its metadata inside of an
556 'EsResult' when the document was successfully found.
556 'EsResult' when the document was successfully found.
557-}
557-}
558data EsResultFound a = EsResultFound { _version :: DocVersion
558data EsResultFound a = EsResultFound { _version :: DocVersion
559− , _source :: a } deriving (Eq, Show, Generic)
559+ , _source :: a } deriving (Eq, Show, Generic, Typeable)
560
560
561{-| 'EsError' is the generic type that will be returned when there was a
561{-| 'EsError' is the generic type that will be returned when there was a
562 problem. If you can't parse the expected response, its a good idea to
562 problem. If you can't parse the expected response, its a good idea to
563 try parsing this.
563 try parsing this.
564-}
564-}
565data EsError = EsError { errorStatus :: Int
565data EsError = EsError { errorStatus :: Int
566− , errorMessage :: Text } deriving (Eq, Show, Generic)
566+ , errorMessage :: Text } deriving (Eq, Show, Generic, Typeable)
567
567
568data IndexAlias = IndexAlias { srcIndex :: IndexName
568data IndexAlias = IndexAlias { srcIndex :: IndexName
569− , indexAlias :: IndexAliasName } deriving (Eq, Show, Generic)
569+ , indexAlias :: IndexAliasName } deriving (Eq, Show, Generic, Typeable)
570
570
571newtype IndexAliasName = IndexAliasName { indexAliasName :: IndexName } deriving (Eq, Show, Generic, ToJSON)
571newtype IndexAliasName = IndexAliasName { indexAliasName :: IndexName } deriving (Eq, Show, Generic, ToJSON)
572
572
@@ -591,7 +591,7 @@ newtype IndexAliasesSummary = IndexAliasesSummary { indexAliasesSummary :: [Inde
591
591
592{-| 'IndexAliasSummary' is a summary of an index alias configured for a server. -}
592{-| 'IndexAliasSummary' is a summary of an index alias configured for a server. -}
593data IndexAliasSummary = IndexAliasSummary { indexAliasSummaryAlias :: IndexAlias
593data IndexAliasSummary = IndexAliasSummary { indexAliasSummaryAlias :: IndexAlias
594− , indexAliasSummaryCreate :: IndexAliasCreate} deriving (Show, Eq, Generic)
594+ , indexAliasSummaryCreate :: IndexAliasCreate} deriving (Show, Eq, Generic, Typeable)
595
595
596{-| 'DocVersion' is an integer version number for a document between 1
596{-| 'DocVersion' is an integer version number for a document between 1
597and 9.2e+18 used for <<https://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html optimistic concurrency control>>.
597and 9.2e+18 used for <<https://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html optimistic concurrency control>>.
@@ -651,7 +651,7 @@ data VersionControl = NoVersionControl
651{-| 'DocumentParent' is used to specify a parent document.
651{-| 'DocumentParent' is used to specify a parent document.
652-}
652-}
653newtype DocumentParent = DocumentParent DocId
653newtype DocumentParent = DocumentParent DocId
654− deriving (Eq, Show, Generic)
654+ deriving (Eq, Show, Generic, Typeable)
655
655
656{-| 'IndexDocumentSettings' are special settings supplied when indexing
656{-| 'IndexDocumentSettings' are special settings supplied when indexing
657a document. For the best backwards compatiblity when new fields are
657a document. For the best backwards compatiblity when new fields are
@@ -660,7 +660,7 @@ added, you should probably prefer to start with 'defaultIndexDocumentSettings'
660data IndexDocumentSettings =
660data IndexDocumentSettings =
661 IndexDocumentSettings { idsVersionControl :: VersionControl
661 IndexDocumentSettings { idsVersionControl :: VersionControl
662 , idsParent :: Maybe DocumentParent
662 , idsParent :: Maybe DocumentParent
663− } deriving (Eq, Show, Generic)
663+ } deriving (Eq, Show, Generic, Typeable)
664
664
665{-| Reasonable default settings. Chooses no version control and no parent.
665{-| Reasonable default settings. Chooses no version control and no parent.
666-}
666-}
@@ -680,7 +680,7 @@ type Sort = [SortSpec]
680<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
680<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
681-}
681-}
682data SortSpec = DefaultSortSpec DefaultSort
682data SortSpec = DefaultSortSpec DefaultSort
683− | GeoDistanceSortSpec SortOrder GeoPoint DistanceUnit deriving (Eq, Show, Generic)
683+ | GeoDistanceSortSpec SortOrder GeoPoint DistanceUnit deriving (Eq, Show, Generic, Typeable)
684
684
685{-| 'DefaultSort' is usually the kind of 'SortSpec' you'll want. There's a
685{-| 'DefaultSort' is usually the kind of 'SortSpec' you'll want. There's a
686 'mkSort' convenience function for when you want to specify only the most
686 'mkSort' convenience function for when you want to specify only the most
@@ -695,7 +695,7 @@ data DefaultSort =
695 , ignoreUnmapped :: Bool
695 , ignoreUnmapped :: Bool
696 , sortMode :: Maybe SortMode
696 , sortMode :: Maybe SortMode
697 , missingSort :: Maybe Missing
697 , missingSort :: Maybe Missing
698− , nestedFilter :: Maybe Filter } deriving (Eq, Show, Generic)
698+ , nestedFilter :: Maybe Filter } deriving (Eq, Show, Generic, Typeable)
699
699
700{-| 'SortOrder' is 'Ascending' or 'Descending', as you might expect. These get
700{-| 'SortOrder' is 'Ascending' or 'Descending', as you might expect. These get
701 encoded into "asc" or "desc" when turned into JSON.
701 encoded into "asc" or "desc" when turned into JSON.
@@ -703,7 +703,7 @@ data DefaultSort =
703<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
703<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
704-}
704-}
705data SortOrder = Ascending
705data SortOrder = Ascending
706− | Descending deriving (Eq, Show, Generic)
706+ | Descending deriving (Eq, Show, Generic, Typeable)
707
707
708{-| 'Missing' prescribes how to handle missing fields. A missing field can be
708{-| 'Missing' prescribes how to handle missing fields. A missing field can be
709 sorted last, first, or using a custom value as a substitute.
709 sorted last, first, or using a custom value as a substitute.
@@ -712,7 +712,7 @@ data SortOrder = Ascending
712-}
712-}
713data Missing = LastMissing
713data Missing = LastMissing
714 | FirstMissing
714 | FirstMissing
715− | CustomMissing Text deriving (Eq, Show, Generic)
715+ | CustomMissing Text deriving (Eq, Show, Generic, Typeable)
716
716
717{-| 'SortMode' prescribes how to handle sorting array/multi-valued fields.
717{-| 'SortMode' prescribes how to handle sorting array/multi-valued fields.
718
718
@@ -721,7 +721,7 @@ http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-req
721data SortMode = SortMin
721data SortMode = SortMin
722 | SortMax
722 | SortMax
723 | SortSum
723 | SortSum
724− | SortAvg deriving (Eq, Show, Generic)
724+ | SortAvg deriving (Eq, Show, Generic, Typeable)
725
725
726{-| 'mkSort' defaults everything but the 'FieldName' and the 'SortOrder' so
726{-| 'mkSort' defaults everything but the 'FieldName' and the 'SortOrder' so
727 that you can concisely describe the usual kind of 'SortSpec's you want.
727 that you can concisely describe the usual kind of 'SortSpec's you want.
@@ -755,7 +755,7 @@ newtype ReplicaCount = ReplicaCount Int deriving (Eq, Show, Generic, ToJSON, Typ
755
755
756{-| 'Server' is used with the client functions to point at the ES instance
756{-| 'Server' is used with the client functions to point at the ES instance
757-}
757-}
758−newtype Server = Server Text deriving (Eq, Show, Generic)
758+newtype Server = Server Text deriving (Eq, Show, Generic, Typeable)
759
759
760{-| 'IndexName' is used to describe which index to query/create/delete
760{-| 'IndexName' is used to describe which index to query/create/delete
761-}
761-}
@@ -793,7 +793,7 @@ newtype FieldName = FieldName Text deriving (Eq, Show, Generic, ToJSON, FromJSON
793{-| 'Script' is often used in place of 'FieldName' to specify more
793{-| 'Script' is often used in place of 'FieldName' to specify more
794complex ways of extracting a value from a document.
794complex ways of extracting a value from a document.
795-}
795-}
796−newtype Script = Script { scriptText :: Text } deriving (Eq, Show, Generic)
796+newtype Script = Script { scriptText :: Text } deriving (Eq, Show, Generic, Typeable)
797
797
798{-| 'CacheName' is used in 'RegexpFilter' for describing the
798{-| 'CacheName' is used in 'RegexpFilter' for describing the
799 'CacheKey' keyed caching behavior.
799 'CacheKey' keyed caching behavior.
@@ -914,7 +914,7 @@ data Search = Search { queryBody :: Maybe Query
914 , size :: Size
914 , size :: Size
915 , searchType :: SearchType
915 , searchType :: SearchType
916 , fields :: Maybe [FieldName]
916 , fields :: Maybe [FieldName]
917− , source :: Maybe Source } deriving (Eq, Show, Generic)
917+ , source :: Maybe Source } deriving (Eq, Show, Generic, Typeable)
918
918
919data SearchType = SearchTypeQueryThenFetch
919data SearchType = SearchTypeQueryThenFetch
920 | SearchTypeDfsQueryThenFetch
920 | SearchTypeDfsQueryThenFetch
@@ -922,40 +922,40 @@ data SearchType = SearchTypeQueryThenFetch
922 | SearchTypeScan
922 | SearchTypeScan
923 | SearchTypeQueryAndFetch
923 | SearchTypeQueryAndFetch
924 | SearchTypeDfsQueryAndFetch
924 | SearchTypeDfsQueryAndFetch
925− deriving (Eq, Show, Generic)
925+ deriving (Eq, Show, Generic, Typeable)
926
926
927data Source =
927data Source =
928 NoSource
928 NoSource
929 | SourcePatterns PatternOrPatterns
929 | SourcePatterns PatternOrPatterns
930 | SourceIncludeExclude Include Exclude
930 | SourceIncludeExclude Include Exclude
931− deriving (Show, Eq, Generic)
931+ deriving (Show, Eq, Generic, Typeable)
932
932
933data PatternOrPatterns = PopPattern Pattern
933data PatternOrPatterns = PopPattern Pattern
934− | PopPatterns [Pattern] deriving (Eq, Show, Generic)
934+ | PopPatterns [Pattern] deriving (Eq, Show, Generic, Typeable)
935
935
936−data Include = Include [Pattern] deriving (Eq, Show, Generic)
936+data Include = Include [Pattern] deriving (Eq, Show, Generic, Typeable)
937−data Exclude = Exclude [Pattern] deriving (Eq, Show, Generic)
937+data Exclude = Exclude [Pattern] deriving (Eq, Show, Generic, Typeable)
938
938
939−newtype Pattern = Pattern Text deriving (Eq, Show, Generic)
939+newtype Pattern = Pattern Text deriving (Eq, Show, Generic, Typeable)
940
940
941data Highlights = Highlights { globalsettings :: Maybe HighlightSettings
941data Highlights = Highlights { globalsettings :: Maybe HighlightSettings
942 , highlightFields :: [FieldHighlight]
942 , highlightFields :: [FieldHighlight]
943− } deriving (Show, Eq, Generic)
943+ } deriving (Show, Eq, Generic, Typeable)
944
944
945data FieldHighlight = FieldHighlight FieldName (Maybe HighlightSettings)
945data FieldHighlight = FieldHighlight FieldName (Maybe HighlightSettings)
946− deriving (Show, Eq, Generic)
946+ deriving (Show, Eq, Generic, Typeable)
947
947
948
948
949data HighlightSettings = Plain PlainHighlight
949data HighlightSettings = Plain PlainHighlight
950 | Postings PostingsHighlight
950 | Postings PostingsHighlight
951 | FastVector FastVectorHighlight
951 | FastVector FastVectorHighlight
952− deriving (Show, Eq, Generic)
952+ deriving (Show, Eq, Generic, Typeable)
953data PlainHighlight =
953data PlainHighlight =
954 PlainHighlight { plainCommon :: Maybe CommonHighlight
954 PlainHighlight { plainCommon :: Maybe CommonHighlight
955− , plainNonPost :: Maybe NonPostings } deriving (Show, Eq, Generic)
955+ , plainNonPost :: Maybe NonPostings } deriving (Show, Eq, Generic, Typeable)
956
956
957 -- This requires that index_options are set to 'offset' in the mapping.
957 -- This requires that index_options are set to 'offset' in the mapping.
958−data PostingsHighlight = PostingsHighlight (Maybe CommonHighlight) deriving (Show, Eq, Generic)
958+data PostingsHighlight = PostingsHighlight (Maybe CommonHighlight) deriving (Show, Eq, Generic, Typeable)
959
959
960-- This requires that term_vector is set to 'with_positions_offsets' in the mapping.
960-- This requires that term_vector is set to 'with_positions_offsets' in the mapping.
961data FastVectorHighlight =
961data FastVectorHighlight =
@@ -966,7 +966,7 @@ data FastVectorHighlight =
966 , fragmentOffset :: Maybe Int
966 , fragmentOffset :: Maybe Int
967 , matchedFields :: [Text]
967 , matchedFields :: [Text]
968 , phraseLimit :: Maybe Int
968 , phraseLimit :: Maybe Int
969− } deriving (Show, Eq, Generic)
969+ } deriving (Show, Eq, Generic, Typeable)
970
970
971data CommonHighlight =
971data CommonHighlight =
972 CommonHighlight { order :: Maybe Text
972 CommonHighlight { order :: Maybe Text
@@ -976,21 +976,21 @@ data CommonHighlight =
976 , noMatchSize :: Maybe Int
976 , noMatchSize :: Maybe Int
977 , highlightQuery :: Maybe Query
977 , highlightQuery :: Maybe Query
978 , requireFieldMatch :: Maybe Bool
978 , requireFieldMatch :: Maybe Bool
979− } deriving (Show, Eq, Generic)
979+ } deriving (Show, Eq, Generic, Typeable)
980
980
981-- Settings that are only applicable to FastVector and Plain highlighters.
981-- Settings that are only applicable to FastVector and Plain highlighters.
982data NonPostings =
982data NonPostings =
983 NonPostings { fragmentSize :: Maybe Int
983 NonPostings { fragmentSize :: Maybe Int
984− , numberOfFragments :: Maybe Int} deriving (Show, Eq, Generic)
984+ , numberOfFragments :: Maybe Int} deriving (Show, Eq, Generic, Typeable)
985
985
986data HighlightEncoder = DefaultEncoder
986data HighlightEncoder = DefaultEncoder
987 | HTMLEncoder
987 | HTMLEncoder
988− deriving (Show, Eq, Generic)
988+ deriving (Show, Eq, Generic, Typeable)
989
989
990-- NOTE: Should the tags use some kind of HTML type, rather than Text?
990-- NOTE: Should the tags use some kind of HTML type, rather than Text?
991data HighlightTag = TagSchema Text
991data HighlightTag = TagSchema Text
992 | CustomTags ([Text], [Text]) -- Only uses more than the first value in the lists if fvh
992 | CustomTags ([Text], [Text]) -- Only uses more than the first value in the lists if fvh
993− deriving (Show, Eq, Generic)
993+ deriving (Show, Eq, Generic, Typeable)
994
994
995
995
996data Query =
996data Query =
@@ -1335,24 +1335,24 @@ newtype Regexp = Regexp Text deriving (Eq, Show, Generic, FromJSON)
1335
1335
1336data RegexpFlags = AllRegexpFlags
1336data RegexpFlags = AllRegexpFlags
1337 | NoRegexpFlags
1337 | NoRegexpFlags
1338− | SomeRegexpFlags (NonEmpty RegexpFlag) deriving (Eq, Show, Generic)
1338+ | SomeRegexpFlags (NonEmpty RegexpFlag) deriving (Eq, Show, Generic, Typeable)
1339
1339
1340data RegexpFlag = AnyString
1340data RegexpFlag = AnyString
1341 | Automaton
1341 | Automaton
1342 | Complement
1342 | Complement
1343 | Empty
1343 | Empty
1344 | Intersection
1344 | Intersection
1345− | Interval deriving (Eq, Show, Generic)
1345+ | Interval deriving (Eq, Show, Generic, Typeable)
1346
1346
1347−newtype LessThan = LessThan Double deriving (Eq, Show, Generic)
1347+newtype LessThan = LessThan Double deriving (Eq, Show, Generic, Typeable)
1348−newtype LessThanEq = LessThanEq Double deriving (Eq, Show, Generic)
1348+newtype LessThanEq = LessThanEq Double deriving (Eq, Show, Generic, Typeable)
1349−newtype GreaterThan = GreaterThan Double deriving (Eq, Show, Generic)
1349+newtype GreaterThan = GreaterThan Double deriving (Eq, Show, Generic, Typeable)
1350−newtype GreaterThanEq = GreaterThanEq Double deriving (Eq, Show, Generic)
1350+newtype GreaterThanEq = GreaterThanEq Double deriving (Eq, Show, Generic, Typeable)
1351
1351
1352−newtype LessThanD = LessThanD UTCTime deriving (Eq, Show, Generic)
1352+newtype LessThanD = LessThanD UTCTime deriving (Eq, Show, Generic, Typeable)
1353−newtype LessThanEqD = LessThanEqD UTCTime deriving (Eq, Show, Generic)
1353+newtype LessThanEqD = LessThanEqD UTCTime deriving (Eq, Show, Generic, Typeable)
1354−newtype GreaterThanD = GreaterThanD UTCTime deriving (Eq, Show, Generic)
1354+newtype GreaterThanD = GreaterThanD UTCTime deriving (Eq, Show, Generic, Typeable)
1355−newtype GreaterThanEqD = GreaterThanEqD UTCTime deriving (Eq, Show, Generic)
1355+newtype GreaterThanEqD = GreaterThanEqD UTCTime deriving (Eq, Show, Generic, Typeable)
1356
1356
1357data RangeValue = RangeDateLte LessThanEqD
1357data RangeValue = RangeDateLte LessThanEqD
1358 | RangeDateLt LessThanD
1358 | RangeDateLt LessThanD
@@ -1370,7 +1370,7 @@ data RangeValue = RangeDateLte LessThanEqD
1370 | RangeDoubleGteLte GreaterThanEq LessThanEq
1370 | RangeDoubleGteLte GreaterThanEq LessThanEq
1371 | RangeDoubleGteLt GreaterThanEq LessThan
1371 | RangeDoubleGteLt GreaterThanEq LessThan
1372 | RangeDoubleGtLte GreaterThan LessThanEq
1372 | RangeDoubleGtLte GreaterThan LessThanEq
1373− deriving (Eq, Show, Generic)
1373+ deriving (Eq, Show, Generic, Typeable)
1374
1374
1375rangeValueToPair :: RangeValue -> [Pair]
1375rangeValueToPair :: RangeValue -> [Pair]
1376rangeValueToPair rv = case rv of
1376rangeValueToPair rv = case rv of
@@ -1443,7 +1443,7 @@ data Distance =
1443
1443
1444data DistanceRange =
1444data DistanceRange =
1445 DistanceRange { distanceFrom :: Distance
1445 DistanceRange { distanceFrom :: Distance
1446− , distanceTo :: Distance } deriving (Eq, Show, Generic)
1446+ , distanceTo :: Distance } deriving (Eq, Show, Generic, Typeable)
1447
1447
1448data SearchResult a =
1448data SearchResult a =
1449 SearchResult { took :: Int
1449 SearchResult { took :: Int
@@ -1451,7 +1451,7 @@ data SearchResult a =
1451 , shards :: ShardResult
1451 , shards :: ShardResult
1452 , searchHits :: SearchHits a
1452 , searchHits :: SearchHits a
1453 , aggregations :: Maybe AggregationResults
1453 , aggregations :: Maybe AggregationResults
1454− , scrollId :: Maybe ScrollId } deriving (Eq, Show, Generic)
1454+ , scrollId :: Maybe ScrollId } deriving (Eq, Show, Generic, Typeable)
1455
1455
1456newtype ScrollId = ScrollId Text deriving (Eq, Show, Generic, Ord, ToJSON, FromJSON)
1456newtype ScrollId = ScrollId Text deriving (Eq, Show, Generic, Ord, ToJSON, FromJSON)
1457
1457
@@ -1460,7 +1460,7 @@ type Score = Maybe Double
1460data SearchHits a =
1460data SearchHits a =
1461 SearchHits { hitsTotal :: Int
1461 SearchHits { hitsTotal :: Int
1462 , maxScore :: Score
1462 , maxScore :: Score
1463− , hits :: [Hit a] } deriving (Eq, Show, Generic)
1463+ , hits :: [Hit a] } deriving (Eq, Show, Generic, Typeable)
1464
1464
1465
1465
1466instance Monoid (SearchHits a) where
1466instance Monoid (SearchHits a) where
@@ -1475,12 +1475,12 @@ data Hit a =
1475 , hitDocId :: DocId
1475 , hitDocId :: DocId
1476 , hitScore :: Score
1476 , hitScore :: Score
1477 , hitSource :: Maybe a
1477 , hitSource :: Maybe a
1478− , hitHighlight :: Maybe HitHighlight } deriving (Eq, Show, Generic)
1478+ , hitHighlight :: Maybe HitHighlight } deriving (Eq, Show, Generic, Typeable)
1479
1479
1480data ShardResult =
1480data ShardResult =
1481 ShardResult { shardTotal :: Int
1481 ShardResult { shardTotal :: Int
1482 , shardsSuccessful :: Int
1482 , shardsSuccessful :: Int
1483− , shardsFailed :: Int } deriving (Eq, Show, Generic)
1483+ , shardsFailed :: Int } deriving (Eq, Show, Generic, Typeable)
1484
1484
1485type HitHighlight = M.Map Text [Text]
1485type HitHighlight = M.Map Text [Text]
1486
1486
@@ -1504,19 +1504,19 @@ mkAggregations :: Text -> Aggregation -> Aggregations
1504mkAggregations name aggregation = M.insert name aggregation emptyAggregations
1504mkAggregations name aggregation = M.insert name aggregation emptyAggregations
1505
1505
1506data TermOrder = TermOrder{ termSortField :: Text
1506data TermOrder = TermOrder{ termSortField :: Text
1507− , termSortOrder :: SortOrder } deriving (Eq, Show, Generic)
1507+ , termSortOrder :: SortOrder } deriving (Eq, Show, Generic, Typeable)
1508
1508
1509data TermInclusion = TermInclusion Text
1509data TermInclusion = TermInclusion Text
1510− | TermPattern Text Text deriving (Eq, Show, Generic)
1510+ | TermPattern Text Text deriving (Eq, Show, Generic, Typeable)
1511
1511
1512data CollectionMode = BreadthFirst
1512data CollectionMode = BreadthFirst
1513− | DepthFirst deriving (Eq, Show, Generic)
1513+ | DepthFirst deriving (Eq, Show, Generic, Typeable)
1514
1514
1515data ExecutionHint = Ordinals
1515data ExecutionHint = Ordinals
1516 | GlobalOrdinals
1516 | GlobalOrdinals
1517 | GlobalOrdinalsHash
1517 | GlobalOrdinalsHash
1518 | GlobalOrdinalsLowCardinality
1518 | GlobalOrdinalsLowCardinality
1519− | Map deriving (Eq, Show, Generic)
1519+ | Map deriving (Eq, Show, Generic, Typeable)
1520
1520
1521data TimeInterval = Weeks
1521data TimeInterval = Weeks
1522 | Days
1522 | Days
@@ -1532,13 +1532,13 @@ data Interval = Year
1532 | Hour
1532 | Hour
1533 | Minute
1533 | Minute
1534 | Second
1534 | Second
1535− | FractionalInterval Float TimeInterval deriving (Eq, Show, Generic)
1535+ | FractionalInterval Float TimeInterval deriving (Eq, Show, Generic, Typeable)
1536
1536
1537data Aggregation = TermsAgg TermsAggregation
1537data Aggregation = TermsAgg TermsAggregation
1538 | DateHistogramAgg DateHistogramAggregation
1538 | DateHistogramAgg DateHistogramAggregation
1539 | ValueCountAgg ValueCountAggregation
1539 | ValueCountAgg ValueCountAggregation
1540 | FilterAgg FilterAggregation
1540 | FilterAgg FilterAggregation
1541− | DateRangeAgg DateRangeAggregation deriving (Eq, Show, Generic)
1541+ | DateRangeAgg DateRangeAggregation deriving (Eq, Show, Generic, Typeable)
1542
1542
1543
1543
1544data TermsAggregation = TermsAggregation { term :: Either Text Text
1544data TermsAggregation = TermsAggregation { term :: Either Text Text
@@ -1551,7 +1551,7 @@ data TermsAggregation = TermsAggregation { term :: Either Text Text
1551 , termCollectMode :: Maybe CollectionMode
1551 , termCollectMode :: Maybe CollectionMode
1552 , termExecutionHint :: Maybe ExecutionHint
1552 , termExecutionHint :: Maybe ExecutionHint
1553 , termAggs :: Maybe Aggregations
1553 , termAggs :: Maybe Aggregations
1554− } deriving (Eq, Show, Generic)
1554+ } deriving (Eq, Show, Generic, Typeable)
1555
1555
1556data DateHistogramAggregation = DateHistogramAggregation { dateField :: FieldName
1556data DateHistogramAggregation = DateHistogramAggregation { dateField :: FieldName
1557 , dateInterval :: Interval
1557 , dateInterval :: Interval
@@ -1562,29 +1562,29 @@ data DateHistogramAggregation = DateHistogramAggregation { dateField :: Fie
1562 , datePreOffset :: Maybe Text
1562 , datePreOffset :: Maybe Text
1563 , datePostOffset :: Maybe Text
1563 , datePostOffset :: Maybe Text
1564 , dateAggs :: Maybe Aggregations
1564 , dateAggs :: Maybe Aggregations
1565− } deriving (Eq, Show, Generic)
1565+ } deriving (Eq, Show, Generic, Typeable)
1566
1566
1567
1567
1568data DateRangeAggregation = DateRangeAggregation { draField :: FieldName
1568data DateRangeAggregation = DateRangeAggregation { draField :: FieldName
1569 , draFormat :: Maybe Text
1569 , draFormat :: Maybe Text
1570 , draRanges :: NonEmpty DateRangeAggRange
1570 , draRanges :: NonEmpty DateRangeAggRange
1571− } deriving (Eq, Show, Generic)
1571+ } deriving (Eq, Show, Generic, Typeable)
1572
1572
1573data DateRangeAggRange = DateRangeFrom DateMathExpr
1573data DateRangeAggRange = DateRangeFrom DateMathExpr
1574 | DateRangeTo DateMathExpr
1574 | DateRangeTo DateMathExpr
1575− | DateRangeFromAndTo DateMathExpr DateMathExpr deriving (Eq, Show, Generic)
1575+ | DateRangeFromAndTo DateMathExpr DateMathExpr deriving (Eq, Show, Generic, Typeable)
1576
1576
1577-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math> for more information.
1577-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math> for more information.
1578−data DateMathExpr = DateMathExpr DateMathAnchor [DateMathModifier] deriving (Eq, Show, Generic)
1578+data DateMathExpr = DateMathExpr DateMathAnchor [DateMathModifier] deriving (Eq, Show, Generic, Typeable)
1579
1579
1580
1580
1581-- | Starting point for a date range. This along with the 'DateMathModifiers' gets you the date ES will start from.
1581-- | Starting point for a date range. This along with the 'DateMathModifiers' gets you the date ES will start from.
1582data DateMathAnchor = DMNow
1582data DateMathAnchor = DMNow
1583− | DMDate Day deriving (Eq, Show, Generic)
1583+ | DMDate Day deriving (Eq, Show, Generic, Typeable)
1584
1584
1585data DateMathModifier = AddTime Int DateMathUnit
1585data DateMathModifier = AddTime Int DateMathUnit
1586 | SubtractTime Int DateMathUnit
1586 | SubtractTime Int DateMathUnit
1587− | RoundDownTo DateMathUnit deriving (Eq, Show, Generic)
1587+ | RoundDownTo DateMathUnit deriving (Eq, Show, Generic, Typeable)
1588
1588
1589data DateMathUnit = DMYear
1589data DateMathUnit = DMYear
1590 | DMMonth
1590 | DMMonth
@@ -1592,15 +1592,15 @@ data DateMathUnit = DMYear
1592 | DMDay
1592 | DMDay
1593 | DMHour
1593 | DMHour
1594 | DMMinute
1594 | DMMinute
1595− | DMSecond deriving (Eq, Show, Generic)
1595+ | DMSecond deriving (Eq, Show, Generic, Typeable)
1596
1596
1597-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html> for more information.
1597-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html> for more information.
1598data ValueCountAggregation = FieldValueCount FieldName
1598data ValueCountAggregation = FieldValueCount FieldName
1599− | ScriptValueCount Script deriving (Eq, Show, Generic)
1599+ | ScriptValueCount Script deriving (Eq, Show, Generic, Typeable)
1600
1600
1601-- | 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.
1601-- | 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.
1602data FilterAggregation = FilterAggregation { faFilter :: Filter
1602data FilterAggregation = FilterAggregation { faFilter :: Filter
1603− , faAggs :: Maybe Aggregations} deriving (Eq, Show, Generic)
1603+ , faAggs :: Maybe Aggregations} deriving (Eq, Show, Generic, Typeable)
1604
1604
1605mkTermsAggregation :: Text -> TermsAggregation
1605mkTermsAggregation :: Text -> TermsAggregation
1606mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
1606mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
@@ -1756,7 +1756,7 @@ data DateRangeResult = DateRangeResult { dateRangeKey :: Text
1756 , dateRangeTo :: Maybe UTCTime
1756 , dateRangeTo :: Maybe UTCTime
1757 , dateRangeToAsString :: Maybe Text
1757 , dateRangeToAsString :: Maybe Text
1758 , dateRangeDocCount :: Int
1758 , dateRangeDocCount :: Int
1759− , dateRangeAggs :: Maybe AggregationResults } deriving (Show, Eq, Generic)
1759+ , dateRangeAggs :: Maybe AggregationResults } deriving (Show, Eq, Generic, Typeable)
1760
1760
1761toTerms :: Text -> AggregationResults -> Maybe (Bucket TermsResult)
1761toTerms :: Text -> AggregationResults -> Maybe (Bucket TermsResult)
1762toTerms t a = M.lookup t a >>= deserialize
1762toTerms t a = M.lookup t a >>= deserialize