git.iko.soy/typeable/bloodhound
on master help sign in
Add Read instances
ca21210Dmitry Dzhus
src/Database/Bloodhound/Types.hs+190−190
@@ -363,7 +363,7 @@ data Version = Version { number :: Text
363 , build_hash :: Text
363 , build_hash :: Text
364 , build_timestamp :: UTCTime
364 , build_timestamp :: UTCTime
365 , build_snapshot :: Bool
365 , build_snapshot :: Bool
366− , lucene_version :: Text } deriving (Eq, Show, Generic, Typeable)
366+ , lucene_version :: Text } deriving (Eq, Read, Show, Generic, Typeable)
367
367
368{-| 'Status' is a data type for describing the JSON body returned by
368{-| 'Status' is a data type for describing the JSON body returned by
369 Elasticsearch when you query its status. This was deprecated in 1.2.0.
369 Elasticsearch when you query its status. This was deprecated in 1.2.0.
@@ -375,7 +375,7 @@ data Status = Status { ok :: Maybe Bool
375 , status :: Int
375 , status :: Int
376 , name :: Text
376 , name :: Text
377 , version :: Version
377 , version :: Version
378− , tagline :: Text } deriving (Eq, Show, Generic)
378+ , tagline :: Text } deriving (Eq, Read, Show, Generic)
379
379
380{-| 'IndexSettings' is used to configure the shards and replicas when you create
380{-| 'IndexSettings' is used to configure the shards and replicas when you create
381 an Elasticsearch Index.
381 an Elasticsearch Index.
@@ -385,7 +385,7 @@ data Status = Status { ok :: Maybe Bool
385
385
386data IndexSettings =
386data IndexSettings =
387 IndexSettings { indexShards :: ShardCount
387 IndexSettings { indexShards :: ShardCount
388− , indexReplicas :: ReplicaCount } deriving (Eq, Show, Generic, Typeable)
388+ , indexReplicas :: ReplicaCount } deriving (Eq, Read, Show, Generic, Typeable)
389
389
390{-| 'defaultIndexSettings' is an 'IndexSettings' with 3 shards and 2 replicas. -}
390{-| 'defaultIndexSettings' is an 'IndexSettings' with 3 shards and 2 replicas. -}
391defaultIndexSettings :: IndexSettings
391defaultIndexSettings :: IndexSettings
@@ -475,35 +475,35 @@ data AllocationPolicy = AllocAll
475 -- ^ Allows shard allocation only for primary shards for new indices.
475 -- ^ Allows shard allocation only for primary shards for new indices.
476 | AllocNone
476 | AllocNone
477 -- ^ No shard allocation is allowed
477 -- ^ No shard allocation is allowed
478− deriving (Eq, Show, Generic, Typeable)
478+ deriving (Eq, Read, Show, Generic, Typeable)
479
479
480data ReplicaBounds = ReplicasBounded Int Int
480data ReplicaBounds = ReplicasBounded Int Int
481 | ReplicasLowerBounded Int
481 | ReplicasLowerBounded Int
482 | ReplicasUnbounded
482 | ReplicasUnbounded
483− deriving (Eq, Show, Generic, Typeable)
483+ deriving (Eq, Read, Show, Generic, Typeable)
484
484
485−newtype Bytes = Bytes Int deriving (Eq, Show, Generic, Typeable, Ord, ToJSON, FromJSON)
485+newtype Bytes = Bytes Int deriving (Eq, Read, Show, Generic, Typeable, Ord, ToJSON, FromJSON)
486
486
487data FSType = FSSimple
487data FSType = FSSimple
488− | FSBuffered deriving (Eq, Show, Generic, Typeable, Ord)
488+ | FSBuffered deriving (Eq, Read, Show, Generic, Typeable, Ord)
489
489
490data InitialShardCount = QuorumShards
490data InitialShardCount = QuorumShards
491 | QuorumMinus1Shards
491 | QuorumMinus1Shards
492 | FullShards
492 | FullShards
493 | FullMinus1Shards
493 | FullMinus1Shards
494 | ExplicitShards Int
494 | ExplicitShards Int
495− deriving (Eq, Show, Generic, Typeable)
495+ deriving (Eq, Read, Show, Generic, Typeable)
496
496
497data NodeAttrFilter = NodeAttrFilter { nodeAttrFilterName :: NodeAttrName
497data NodeAttrFilter = NodeAttrFilter { nodeAttrFilterName :: NodeAttrName
498 , nodeAttrFilterValues :: NonEmpty Text}
498 , nodeAttrFilterValues :: NonEmpty Text}
499− deriving (Eq, Show, Generic, Ord)
499+ deriving (Eq, Read, Show, Generic, Ord)
500
500
501−newtype NodeAttrName = NodeAttrName Text deriving (Eq, Show, Ord, Generic, Typeable)
501+newtype NodeAttrName = NodeAttrName Text deriving (Eq, Read, Show, Ord, Generic, Typeable)
502
502
503data CompoundFormat = CompoundFileFormat Bool
503data CompoundFormat = CompoundFileFormat Bool
504 | MergeSegmentVsTotalIndex Double
504 | MergeSegmentVsTotalIndex Double
505 -- ^ percentage between 0 and 1 where 0 is false, 1 is true
505 -- ^ percentage between 0 and 1 where 0 is false, 1 is true
506− deriving (Eq, Show, Generic, Typeable)
506+ deriving (Eq, Read, Show, Generic, Typeable)
507
507
508newtype NominalDiffTimeJSON = NominalDiffTimeJSON { ndtJSON :: NominalDiffTime }
508newtype NominalDiffTimeJSON = NominalDiffTimeJSON { ndtJSON :: NominalDiffTime }
509
509
@@ -520,7 +520,7 @@ type Method = NHTM.Method
520
520
521 <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html>
521 <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html>
522-}
522-}
523−data OpenCloseIndex = OpenIndex | CloseIndex deriving (Eq, Show, Generic, Typeable)
523+data OpenCloseIndex = OpenIndex | CloseIndex deriving (Eq, Read, Show, Generic, Typeable)
524
524
525data FieldType = GeoPointType
525data FieldType = GeoPointType
526 | GeoShapeType
526 | GeoShapeType
@@ -528,10 +528,10 @@ data FieldType = GeoPointType
528 | IntegerType
528 | IntegerType
529 | LongType
529 | LongType
530 | ShortType
530 | ShortType
531− | ByteType deriving (Eq, Show, Generic, Typeable)
531+ | ByteType deriving (Eq, Read, Show, Generic, Typeable)
532
532
533data FieldDefinition =
533data FieldDefinition =
534− FieldDefinition { fieldType :: FieldType } deriving (Eq, Show, Generic, Typeable)
534+ FieldDefinition { fieldType :: FieldType } deriving (Eq, Read, Show, Generic, Typeable)
535
535
536{-| An 'IndexTemplate' defines a template that will automatically be
536{-| An 'IndexTemplate' defines a template that will automatically be
537 applied to new indices created. The templates include both
537 applied to new indices created. The templates include both
@@ -549,7 +549,7 @@ data IndexTemplate =
549
549
550data MappingField =
550data MappingField =
551 MappingField { mappingFieldName :: FieldName
551 MappingField { mappingFieldName :: FieldName
552− , fieldDefinition :: FieldDefinition } deriving (Eq, Show, Generic, Typeable)
552+ , fieldDefinition :: FieldDefinition } deriving (Eq, Read, Show, Generic, Typeable)
553
553
554{-| Support for type reification of 'Mapping's is currently incomplete, for
554{-| Support for type reification of 'Mapping's is currently incomplete, for
555 now the mapping API verbiage expects a 'ToJSON'able blob.
555 now the mapping API verbiage expects a 'ToJSON'able blob.
@@ -559,7 +559,7 @@ data MappingField =
559 and keeping different kinds of documents separated if possible.
559 and keeping different kinds of documents separated if possible.
560-}
560-}
561data Mapping = Mapping { typeName :: TypeName
561data Mapping = Mapping { typeName :: TypeName
562− , mappingFields :: [MappingField] } deriving (Eq, Show, Generic, Typeable)
562+ , mappingFields :: [MappingField] } deriving (Eq, Read, Show, Generic, Typeable)
563
563
564{-| 'BulkOperation' is a sum type for expressing the four kinds of bulk
564{-| 'BulkOperation' is a sum type for expressing the four kinds of bulk
565 operation index, create, delete, and update. 'BulkIndex' behaves like an
565 operation index, create, delete, and update. 'BulkIndex' behaves like an
@@ -571,7 +571,7 @@ data BulkOperation =
571 BulkIndex IndexName MappingName DocId Value
571 BulkIndex IndexName MappingName DocId Value
572 | BulkCreate IndexName MappingName DocId Value
572 | BulkCreate IndexName MappingName DocId Value
573 | BulkDelete IndexName MappingName DocId
573 | BulkDelete IndexName MappingName DocId
574− | BulkUpdate IndexName MappingName DocId Value deriving (Eq, Show, Generic, Typeable)
574+ | BulkUpdate IndexName MappingName DocId Value deriving (Eq, Read, Show, Generic, Typeable)
575
575
576{-| 'EsResult' describes the standard wrapper JSON document that you see in
576{-| 'EsResult' describes the standard wrapper JSON document that you see in
577 successful Elasticsearch lookups or lookups that couldn't find the document.
577 successful Elasticsearch lookups or lookups that couldn't find the document.
@@ -579,20 +579,20 @@ data BulkOperation =
579data EsResult a = EsResult { _index :: Text
579data EsResult a = EsResult { _index :: Text
580 , _type :: Text
580 , _type :: Text
581 , _id :: Text
581 , _id :: Text
582− , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Show, Generic, Typeable)
582+ , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Read, Show, Generic, Typeable)
583
583
584{-| 'EsResultFound' contains the document and its metadata inside of an
584{-| 'EsResultFound' contains the document and its metadata inside of an
585 'EsResult' when the document was successfully found.
585 'EsResult' when the document was successfully found.
586-}
586-}
587data EsResultFound a = EsResultFound { _version :: DocVersion
587data EsResultFound a = EsResultFound { _version :: DocVersion
588− , _source :: a } deriving (Eq, Show, Generic, Typeable)
588+ , _source :: a } deriving (Eq, Read, Show, Generic, Typeable)
589
589
590{-| 'EsError' is the generic type that will be returned when there was a
590{-| 'EsError' is the generic type that will be returned when there was a
591 problem. If you can't parse the expected response, its a good idea to
591 problem. If you can't parse the expected response, its a good idea to
592 try parsing this.
592 try parsing this.
593-}
593-}
594data EsError = EsError { errorStatus :: Int
594data EsError = EsError { errorStatus :: Int
595− , errorMessage :: Text } deriving (Eq, Show, Generic, Typeable)
595+ , errorMessage :: Text } deriving (Eq, Read, Show, Generic, Typeable)
596
596
597{-| 'EsProtocolException' will be thrown if Bloodhound cannot parse a response
597{-| 'EsProtocolException' will be thrown if Bloodhound cannot parse a response
598returned by the ElasticSearch server. If you encounter this error, please
598returned by the ElasticSearch server. If you encounter this error, please
@@ -603,44 +603,44 @@ incompatibility between Bloodhound and ElasticSearch. Please open a bug report
603and be sure to include the exception body.
603and be sure to include the exception body.
604-}
604-}
605data EsProtocolException = EsProtocolException { esProtoExBody :: L.ByteString }
605data EsProtocolException = EsProtocolException { esProtoExBody :: L.ByteString }
606− deriving (Eq, Show, Generic, Typeable)
606+ deriving (Eq, Read, Show, Generic, Typeable)
607
607
608instance Exception EsProtocolException
608instance Exception EsProtocolException
609
609
610data IndexAlias = IndexAlias { srcIndex :: IndexName
610data IndexAlias = IndexAlias { srcIndex :: IndexName
611− , indexAlias :: IndexAliasName } deriving (Eq, Show, Generic, Typeable)
611+ , indexAlias :: IndexAliasName } deriving (Eq, Read, Show, Generic, Typeable)
612
612
613−newtype IndexAliasName = IndexAliasName { indexAliasName :: IndexName } deriving (Eq, Show, Generic, ToJSON)
613+newtype IndexAliasName = IndexAliasName { indexAliasName :: IndexName } deriving (Eq, Read, Show, Generic, ToJSON)
614
614
615data IndexAliasAction = AddAlias IndexAlias IndexAliasCreate
615data IndexAliasAction = AddAlias IndexAlias IndexAliasCreate
616− | RemoveAlias IndexAlias deriving (Show, Eq, Generic, Typeable)
616+ | RemoveAlias IndexAlias deriving (Read, Show, Eq, Generic, Typeable)
617
617
618data IndexAliasCreate = IndexAliasCreate { aliasCreateRouting :: Maybe AliasRouting
618data IndexAliasCreate = IndexAliasCreate { aliasCreateRouting :: Maybe AliasRouting
619 , aliasCreateFilter :: Maybe Filter}
619 , aliasCreateFilter :: Maybe Filter}
620− deriving (Show, Eq, Generic, Typeable)
620+ deriving (Read, Show, Eq, Generic, Typeable)
621
621
622data AliasRouting = AllAliasRouting RoutingValue
622data AliasRouting = AllAliasRouting RoutingValue
623 | GranularAliasRouting (Maybe SearchAliasRouting) (Maybe IndexAliasRouting)
623 | GranularAliasRouting (Maybe SearchAliasRouting) (Maybe IndexAliasRouting)
624− deriving (Show, Eq, Generic, Typeable)
624+ deriving (Read, Show, Eq, Generic, Typeable)
625
625
626−newtype SearchAliasRouting = SearchAliasRouting (NonEmpty RoutingValue) deriving (Show, Eq, Generic, Typeable)
626+newtype SearchAliasRouting = SearchAliasRouting (NonEmpty RoutingValue) deriving (Read, Show, Eq, Generic, Typeable)
627
627
628−newtype IndexAliasRouting = IndexAliasRouting RoutingValue deriving (Show, Eq, Generic, ToJSON, FromJSON, Typeable)
628+newtype IndexAliasRouting = IndexAliasRouting RoutingValue deriving (Read, Show, Eq, Generic, ToJSON, FromJSON, Typeable)
629
629
630−newtype RoutingValue = RoutingValue { routingValue :: Text } deriving (Show, Eq, Generic, ToJSON, FromJSON, Typeable)
630+newtype RoutingValue = RoutingValue { routingValue :: Text } deriving (Read, Show, Eq, Generic, ToJSON, FromJSON, Typeable)
631
631
632−newtype IndexAliasesSummary = IndexAliasesSummary { indexAliasesSummary :: [IndexAliasSummary] } deriving (Show, Eq, Generic, Typeable)
632+newtype IndexAliasesSummary = IndexAliasesSummary { indexAliasesSummary :: [IndexAliasSummary] } deriving (Read, Show, Eq, Generic, Typeable)
633
633
634{-| 'IndexAliasSummary' is a summary of an index alias configured for a server. -}
634{-| 'IndexAliasSummary' is a summary of an index alias configured for a server. -}
635data IndexAliasSummary = IndexAliasSummary { indexAliasSummaryAlias :: IndexAlias
635data IndexAliasSummary = IndexAliasSummary { indexAliasSummaryAlias :: IndexAlias
636− , indexAliasSummaryCreate :: IndexAliasCreate} deriving (Show, Eq, Generic, Typeable)
636+ , indexAliasSummaryCreate :: IndexAliasCreate} deriving (Read, Show, Eq, Generic, Typeable)
637
637
638{-| 'DocVersion' is an integer version number for a document between 1
638{-| 'DocVersion' is an integer version number for a document between 1
639and 9.2e+18 used for <<https://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html optimistic concurrency control>>.
639and 9.2e+18 used for <<https://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html optimistic concurrency control>>.
640-}
640-}
641newtype DocVersion = DocVersion {
641newtype DocVersion = DocVersion {
642 docVersionNumber :: Int
642 docVersionNumber :: Int
643− } deriving (Eq, Show, Generic, Ord, ToJSON)
643+ } deriving (Eq, Read, Show, Generic, Ord, ToJSON)
644
644
645-- | Smart constructor for in-range doc version
645-- | Smart constructor for in-range doc version
646mkDocVersion :: Int -> Maybe DocVersion
646mkDocVersion :: Int -> Maybe DocVersion
@@ -654,7 +654,7 @@ mkDocVersion i
654own version numbers instead of ones from ES.
654own version numbers instead of ones from ES.
655-}
655-}
656newtype ExternalDocVersion = ExternalDocVersion DocVersion
656newtype ExternalDocVersion = ExternalDocVersion DocVersion
657− deriving (Eq, Show, Generic, Ord, Bounded, Enum, ToJSON)
657+ deriving (Eq, Read, Show, Generic, Ord, Bounded, Enum, ToJSON)
658
658
659{-| 'VersionControl' is specified when indexing documents as a
659{-| 'VersionControl' is specified when indexing documents as a
660optimistic concurrency control.
660optimistic concurrency control.
@@ -688,12 +688,12 @@ data VersionControl = NoVersionControl
688 -- given version will be the new version. This is
688 -- given version will be the new version. This is
689 -- typically used for correcting errors. Use with
689 -- typically used for correcting errors. Use with
690 -- care, as this could result in data loss.
690 -- care, as this could result in data loss.
691− deriving (Show, Eq, Generic, Ord)
691+ deriving (Read, Show, Eq, Generic, Ord)
692
692
693{-| 'DocumentParent' is used to specify a parent document.
693{-| 'DocumentParent' is used to specify a parent document.
694-}
694-}
695newtype DocumentParent = DocumentParent DocId
695newtype DocumentParent = DocumentParent DocId
696− deriving (Eq, Show, Generic, Typeable)
696+ deriving (Eq, Read, Show, Generic, Typeable)
697
697
698{-| 'IndexDocumentSettings' are special settings supplied when indexing
698{-| 'IndexDocumentSettings' are special settings supplied when indexing
699a document. For the best backwards compatiblity when new fields are
699a document. For the best backwards compatiblity when new fields are
@@ -702,7 +702,7 @@ added, you should probably prefer to start with 'defaultIndexDocumentSettings'
702data IndexDocumentSettings =
702data IndexDocumentSettings =
703 IndexDocumentSettings { idsVersionControl :: VersionControl
703 IndexDocumentSettings { idsVersionControl :: VersionControl
704 , idsParent :: Maybe DocumentParent
704 , idsParent :: Maybe DocumentParent
705− } deriving (Eq, Show, Generic, Typeable)
705+ } deriving (Eq, Read, Show, Generic, Typeable)
706
706
707{-| Reasonable default settings. Chooses no version control and no parent.
707{-| Reasonable default settings. Chooses no version control and no parent.
708-}
708-}
@@ -722,7 +722,7 @@ type Sort = [SortSpec]
722<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
722<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
723-}
723-}
724data SortSpec = DefaultSortSpec DefaultSort
724data SortSpec = DefaultSortSpec DefaultSort
725− | GeoDistanceSortSpec SortOrder GeoPoint DistanceUnit deriving (Eq, Show, Generic, Typeable)
725+ | GeoDistanceSortSpec SortOrder GeoPoint DistanceUnit deriving (Eq, Read, Show, Generic, Typeable)
726
726
727{-| 'DefaultSort' is usually the kind of 'SortSpec' you'll want. There's a
727{-| 'DefaultSort' is usually the kind of 'SortSpec' you'll want. There's a
728 'mkSort' convenience function for when you want to specify only the most
728 'mkSort' convenience function for when you want to specify only the most
@@ -737,7 +737,7 @@ data DefaultSort =
737 , ignoreUnmapped :: Bool
737 , ignoreUnmapped :: Bool
738 , sortMode :: Maybe SortMode
738 , sortMode :: Maybe SortMode
739 , missingSort :: Maybe Missing
739 , missingSort :: Maybe Missing
740− , nestedFilter :: Maybe Filter } deriving (Eq, Show, Generic, Typeable)
740+ , nestedFilter :: Maybe Filter } deriving (Eq, Read, Show, Generic, Typeable)
741
741
742{-| 'SortOrder' is 'Ascending' or 'Descending', as you might expect. These get
742{-| 'SortOrder' is 'Ascending' or 'Descending', as you might expect. These get
743 encoded into "asc" or "desc" when turned into JSON.
743 encoded into "asc" or "desc" when turned into JSON.
@@ -745,7 +745,7 @@ data DefaultSort =
745<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
745<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
746-}
746-}
747data SortOrder = Ascending
747data SortOrder = Ascending
748− | Descending deriving (Eq, Show, Generic, Typeable)
748+ | Descending deriving (Eq, Read, Show, Generic, Typeable)
749
749
750{-| 'Missing' prescribes how to handle missing fields. A missing field can be
750{-| 'Missing' prescribes how to handle missing fields. A missing field can be
751 sorted last, first, or using a custom value as a substitute.
751 sorted last, first, or using a custom value as a substitute.
@@ -754,7 +754,7 @@ data SortOrder = Ascending
754-}
754-}
755data Missing = LastMissing
755data Missing = LastMissing
756 | FirstMissing
756 | FirstMissing
757− | CustomMissing Text deriving (Eq, Show, Generic, Typeable)
757+ | CustomMissing Text deriving (Eq, Read, Show, Generic, Typeable)
758
758
759{-| 'SortMode' prescribes how to handle sorting array/multi-valued fields.
759{-| 'SortMode' prescribes how to handle sorting array/multi-valued fields.
760
760
@@ -763,7 +763,7 @@ http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-req
763data SortMode = SortMin
763data SortMode = SortMin
764 | SortMax
764 | SortMax
765 | SortSum
765 | SortSum
766− | SortAvg deriving (Eq, Show, Generic, Typeable)
766+ | SortAvg deriving (Eq, Read, Show, Generic, Typeable)
767
767
768{-| 'mkSort' defaults everything but the 'FieldName' and the 'SortOrder' so
768{-| 'mkSort' defaults everything but the 'FieldName' and the 'SortOrder' so
769 that you can concisely describe the usual kind of 'SortSpec's you want.
769 that you can concisely describe the usual kind of 'SortSpec's you want.
@@ -785,19 +785,19 @@ type PrefixValue = Text
785{-| 'BooleanOperator' is the usual And/Or operators with an ES compatible
785{-| 'BooleanOperator' is the usual And/Or operators with an ES compatible
786 JSON encoding baked in. Used all over the place.
786 JSON encoding baked in. Used all over the place.
787-}
787-}
788−data BooleanOperator = And | Or deriving (Eq, Show, Generic, Typeable)
788+data BooleanOperator = And | Or deriving (Eq, Read, Show, Generic, Typeable)
789
789
790{-| 'ShardCount' is part of 'IndexSettings'
790{-| 'ShardCount' is part of 'IndexSettings'
791-}
791-}
792−newtype ShardCount = ShardCount Int deriving (Eq, Show, Generic, ToJSON, Typeable)
792+newtype ShardCount = ShardCount Int deriving (Eq, Read, Show, Generic, ToJSON, Typeable)
793
793
794{-| 'ReplicaCount' is part of 'IndexSettings'
794{-| 'ReplicaCount' is part of 'IndexSettings'
795-}
795-}
796−newtype ReplicaCount = ReplicaCount Int deriving (Eq, Show, Generic, ToJSON, Typeable)
796+newtype ReplicaCount = ReplicaCount Int deriving (Eq, Read, Show, Generic, ToJSON, Typeable)
797
797
798{-| 'IndexName' is used to describe which index to query/create/delete
798{-| 'IndexName' is used to describe which index to query/create/delete
799-}
799-}
800−newtype IndexName = IndexName Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
800+newtype IndexName = IndexName Text deriving (Eq, Generic, Read, Show, ToJSON, FromJSON, Typeable)
801
801
802{-| 'IndexSelection' is used for APIs which take a single index, a list of
802{-| 'IndexSelection' is used for APIs which take a single index, a list of
803 indexes, or the special @_all@ index.
803 indexes, or the special @_all@ index.
@@ -807,133 +807,133 @@ data IndexSelection = IndexList (NonEmpty IndexName)
807
807
808{-| 'TemplateName' is used to describe which template to query/create/delete
808{-| 'TemplateName' is used to describe which template to query/create/delete
809-}
809-}
810−newtype TemplateName = TemplateName Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
810+newtype TemplateName = TemplateName Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
811
811
812{-| 'TemplatePattern' represents a pattern which is matched against index names
812{-| 'TemplatePattern' represents a pattern which is matched against index names
813-}
813-}
814−newtype TemplatePattern = TemplatePattern Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
814+newtype TemplatePattern = TemplatePattern Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
815
815
816{-| 'MappingName' is part of mappings which are how ES describes and schematizes
816{-| 'MappingName' is part of mappings which are how ES describes and schematizes
817 the data in the indices.
817 the data in the indices.
818-}
818-}
819−newtype MappingName = MappingName Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
819+newtype MappingName = MappingName Text deriving (Eq, Generic, Read, Show, ToJSON, FromJSON, Typeable)
820
820
821{-| 'DocId' is a generic wrapper value for expressing unique Document IDs.
821{-| 'DocId' is a generic wrapper value for expressing unique Document IDs.
822 Can be set by the user or created by ES itself. Often used in client
822 Can be set by the user or created by ES itself. Often used in client
823 functions for poking at specific documents.
823 functions for poking at specific documents.
824-}
824-}
825−newtype DocId = DocId Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
825+newtype DocId = DocId Text deriving (Eq, Generic, Read, Show, ToJSON, FromJSON, Typeable)
826
826
827{-| 'QueryString' is used to wrap query text bodies, be they human written or not.
827{-| 'QueryString' is used to wrap query text bodies, be they human written or not.
828-}
828-}
829−newtype QueryString = QueryString Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
829+newtype QueryString = QueryString Text deriving (Eq, Generic, Read, Show, ToJSON, FromJSON, Typeable)
830
830
831{-| 'FieldName' is used all over the place wherever a specific field within
831{-| 'FieldName' is used all over the place wherever a specific field within
832 a document needs to be specified, usually in 'Query's or 'Filter's.
832 a document needs to be specified, usually in 'Query's or 'Filter's.
833-}
833-}
834−newtype FieldName = FieldName Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
834+newtype FieldName = FieldName Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
835
835
836
836
837{-| 'Script' is often used in place of 'FieldName' to specify more
837{-| 'Script' is often used in place of 'FieldName' to specify more
838complex ways of extracting a value from a document.
838complex ways of extracting a value from a document.
839-}
839-}
840−newtype Script = Script { scriptText :: Text } deriving (Eq, Show, Generic, Typeable)
840+newtype Script = Script { scriptText :: Text } deriving (Eq, Read, Show, Generic, Typeable)
841
841
842{-| 'CacheName' is used in 'RegexpFilter' for describing the
842{-| 'CacheName' is used in 'RegexpFilter' for describing the
843 'CacheKey' keyed caching behavior.
843 'CacheKey' keyed caching behavior.
844-}
844-}
845−newtype CacheName = CacheName Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
845+newtype CacheName = CacheName Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
846
846
847{-| 'CacheKey' is used in 'RegexpFilter' to key regex caching.
847{-| 'CacheKey' is used in 'RegexpFilter' to key regex caching.
848-}
848-}
849newtype CacheKey =
849newtype CacheKey =
850− CacheKey Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
850+ CacheKey Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
851newtype Existence =
851newtype Existence =
852− Existence Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
852+ Existence Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
853newtype NullValue =
853newtype NullValue =
854− NullValue Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
854+ NullValue Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
855newtype CutoffFrequency =
855newtype CutoffFrequency =
856− CutoffFrequency Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
856+ CutoffFrequency Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
857newtype Analyzer =
857newtype Analyzer =
858− Analyzer Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
858+ Analyzer Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
859newtype MaxExpansions =
859newtype MaxExpansions =
860− MaxExpansions Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
860+ MaxExpansions Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
861
861
862{-| 'Lenient', if set to true, will cause format based failures to be
862{-| 'Lenient', if set to true, will cause format based failures to be
863 ignored. I don't know what the bloody default is, Elasticsearch
863 ignored. I don't know what the bloody default is, Elasticsearch
864 documentation didn't say what it was. Let me know if you figure it out.
864 documentation didn't say what it was. Let me know if you figure it out.
865-}
865-}
866newtype Lenient =
866newtype Lenient =
867− Lenient Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
867+ Lenient Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
868newtype Tiebreaker =
868newtype Tiebreaker =
869− Tiebreaker Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
869+ Tiebreaker Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
870newtype Boost =
870newtype Boost =
871− Boost Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
871+ Boost Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
872newtype BoostTerms =
872newtype BoostTerms =
873− BoostTerms Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
873+ BoostTerms Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
874
874
875{-| 'MinimumMatch' controls how many should clauses in the bool query should
875{-| 'MinimumMatch' controls how many should clauses in the bool query should
876 match. Can be an absolute value (2) or a percentage (30%) or a
876 match. Can be an absolute value (2) or a percentage (30%) or a
877 combination of both.
877 combination of both.
878-}
878-}
879newtype MinimumMatch =
879newtype MinimumMatch =
880− MinimumMatch Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
880+ MinimumMatch Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
881newtype DisableCoord =
881newtype DisableCoord =
882− DisableCoord Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
882+ DisableCoord Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
883newtype IgnoreTermFrequency =
883newtype IgnoreTermFrequency =
884− IgnoreTermFrequency Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
884+ IgnoreTermFrequency Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
885newtype MinimumTermFrequency =
885newtype MinimumTermFrequency =
886− MinimumTermFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
886+ MinimumTermFrequency Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
887newtype MaxQueryTerms =
887newtype MaxQueryTerms =
888− MaxQueryTerms Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
888+ MaxQueryTerms Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
889newtype Fuzziness =
889newtype Fuzziness =
890− Fuzziness Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
890+ Fuzziness Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
891
891
892{-| 'PrefixLength' is the prefix length used in queries, defaults to 0. -}
892{-| 'PrefixLength' is the prefix length used in queries, defaults to 0. -}
893newtype PrefixLength =
893newtype PrefixLength =
894− PrefixLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
894+ PrefixLength Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
895newtype TypeName =
895newtype TypeName =
896− TypeName Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
896+ TypeName Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
897newtype PercentMatch =
897newtype PercentMatch =
898− PercentMatch Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
898+ PercentMatch Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
899newtype StopWord =
899newtype StopWord =
900− StopWord Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
900+ StopWord Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
901newtype QueryPath =
901newtype QueryPath =
902− QueryPath Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
902+ QueryPath Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
903
903
904{-| Allowing a wildcard at the beginning of a word (eg "*ing") is particularly
904{-| Allowing a wildcard at the beginning of a word (eg "*ing") is particularly
905 heavy, because all terms in the index need to be examined, just in case
905 heavy, because all terms in the index need to be examined, just in case
906 they match. Leading wildcards can be disabled by setting
906 they match. Leading wildcards can be disabled by setting
907 'AllowLeadingWildcard' to false. -}
907 'AllowLeadingWildcard' to false. -}
908newtype AllowLeadingWildcard =
908newtype AllowLeadingWildcard =
909− AllowLeadingWildcard Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
909+ AllowLeadingWildcard Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
910newtype LowercaseExpanded =
910newtype LowercaseExpanded =
911− LowercaseExpanded Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
911+ LowercaseExpanded Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
912newtype EnablePositionIncrements =
912newtype EnablePositionIncrements =
913− EnablePositionIncrements Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
913+ EnablePositionIncrements Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
914
914
915{-| By default, wildcard terms in a query are not analyzed.
915{-| By default, wildcard terms in a query are not analyzed.
916 Setting 'AnalyzeWildcard' to true enables best-effort analysis.
916 Setting 'AnalyzeWildcard' to true enables best-effort analysis.
917-}
917-}
918−newtype AnalyzeWildcard = AnalyzeWildcard Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
918+newtype AnalyzeWildcard = AnalyzeWildcard Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
919
919
920{-| 'GeneratePhraseQueries' defaults to false.
920{-| 'GeneratePhraseQueries' defaults to false.
921-}
921-}
922newtype GeneratePhraseQueries =
922newtype GeneratePhraseQueries =
923− GeneratePhraseQueries Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
923+ GeneratePhraseQueries Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
924
924
925{-| 'Locale' is used for string conversions - defaults to ROOT.
925{-| 'Locale' is used for string conversions - defaults to ROOT.
926-}
926-}
927−newtype Locale = Locale Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
927+newtype Locale = Locale Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
928−newtype MaxWordLength = MaxWordLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
928+newtype MaxWordLength = MaxWordLength Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
929−newtype MinWordLength = MinWordLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
929+newtype MinWordLength = MinWordLength Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
930
930
931{-| 'PhraseSlop' sets the default slop for phrases, 0 means exact
931{-| 'PhraseSlop' sets the default slop for phrases, 0 means exact
932 phrase matches. Default is 0.
932 phrase matches. Default is 0.
933-}
933-}
934−newtype PhraseSlop = PhraseSlop Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
934+newtype PhraseSlop = PhraseSlop Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
935−newtype MinDocFrequency = MinDocFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
935+newtype MinDocFrequency = MinDocFrequency Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
936−newtype MaxDocFrequency = MaxDocFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
936+newtype MaxDocFrequency = MaxDocFrequency Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
937
937
938-- | Newtype wrapper to parse ES's concerning tendency to in some APIs return a floating point number of milliseconds since epoch ಠ_ಠ
938-- | Newtype wrapper to parse ES's concerning tendency to in some APIs return a floating point number of milliseconds since epoch ಠ_ಠ
939newtype POSIXMS = POSIXMS { posixMS :: UTCTime }
939newtype POSIXMS = POSIXMS { posixMS :: UTCTime }
@@ -944,8 +944,8 @@ unpackId :: DocId -> Text
944unpackId (DocId docId) = docId
944unpackId (DocId docId) = docId
945
945
946type TrackSortScores = Bool
946type TrackSortScores = Bool
947−newtype From = From Int deriving (Eq, Show, Generic, ToJSON)
947+newtype From = From Int deriving (Eq, Read, Show, Generic, ToJSON)
948−newtype Size = Size Int deriving (Eq, Show, Generic, ToJSON)
948+newtype Size = Size Int deriving (Eq, Read, Show, Generic, ToJSON)
949
949
950data Search = Search { queryBody :: Maybe Query
950data Search = Search { queryBody :: Maybe Query
951 , filterBody :: Maybe Filter
951 , filterBody :: Maybe Filter
@@ -958,7 +958,7 @@ data Search = Search { queryBody :: Maybe Query
958 , size :: Size
958 , size :: Size
959 , searchType :: SearchType
959 , searchType :: SearchType
960 , fields :: Maybe [FieldName]
960 , fields :: Maybe [FieldName]
961− , source :: Maybe Source } deriving (Eq, Show, Generic, Typeable)
961+ , source :: Maybe Source } deriving (Eq, Read, Show, Generic, Typeable)
962
962
963data SearchType = SearchTypeQueryThenFetch
963data SearchType = SearchTypeQueryThenFetch
964 | SearchTypeDfsQueryThenFetch
964 | SearchTypeDfsQueryThenFetch
@@ -966,40 +966,40 @@ data SearchType = SearchTypeQueryThenFetch
966 | SearchTypeScan
966 | SearchTypeScan
967 | SearchTypeQueryAndFetch
967 | SearchTypeQueryAndFetch
968 | SearchTypeDfsQueryAndFetch
968 | SearchTypeDfsQueryAndFetch
969− deriving (Eq, Show, Generic, Typeable)
969+ deriving (Eq, Read, Show, Generic, Typeable)
970
970
971data Source =
971data Source =
972 NoSource
972 NoSource
973 | SourcePatterns PatternOrPatterns
973 | SourcePatterns PatternOrPatterns
974 | SourceIncludeExclude Include Exclude
974 | SourceIncludeExclude Include Exclude
975− deriving (Show, Eq, Generic, Typeable)
975+ deriving (Read, Show, Eq, Generic, Typeable)
976
976
977data PatternOrPatterns = PopPattern Pattern
977data PatternOrPatterns = PopPattern Pattern
978− | PopPatterns [Pattern] deriving (Eq, Show, Generic, Typeable)
978+ | PopPatterns [Pattern] deriving (Eq, Read, Show, Generic, Typeable)
979
979
980−data Include = Include [Pattern] deriving (Eq, Show, Generic, Typeable)
980+data Include = Include [Pattern] deriving (Eq, Read, Show, Generic, Typeable)
981−data Exclude = Exclude [Pattern] deriving (Eq, Show, Generic, Typeable)
981+data Exclude = Exclude [Pattern] deriving (Eq, Read, Show, Generic, Typeable)
982
982
983−newtype Pattern = Pattern Text deriving (Eq, Show, Generic, Typeable)
983+newtype Pattern = Pattern Text deriving (Eq, Read, Show, Generic, Typeable)
984
984
985data Highlights = Highlights { globalsettings :: Maybe HighlightSettings
985data Highlights = Highlights { globalsettings :: Maybe HighlightSettings
986 , highlightFields :: [FieldHighlight]
986 , highlightFields :: [FieldHighlight]
987− } deriving (Show, Eq, Generic, Typeable)
987+ } deriving (Read, Show, Eq, Generic, Typeable)
988
988
989data FieldHighlight = FieldHighlight FieldName (Maybe HighlightSettings)
989data FieldHighlight = FieldHighlight FieldName (Maybe HighlightSettings)
990− deriving (Show, Eq, Generic, Typeable)
990+ deriving (Read, Show, Eq, Generic, Typeable)
991
991
992
992
993data HighlightSettings = Plain PlainHighlight
993data HighlightSettings = Plain PlainHighlight
994 | Postings PostingsHighlight
994 | Postings PostingsHighlight
995 | FastVector FastVectorHighlight
995 | FastVector FastVectorHighlight
996− deriving (Show, Eq, Generic, Typeable)
996+ deriving (Read, Show, Eq, Generic, Typeable)
997data PlainHighlight =
997data PlainHighlight =
998 PlainHighlight { plainCommon :: Maybe CommonHighlight
998 PlainHighlight { plainCommon :: Maybe CommonHighlight
999− , plainNonPost :: Maybe NonPostings } deriving (Show, Eq, Generic, Typeable)
999+ , plainNonPost :: Maybe NonPostings } deriving (Read, Show, Eq, Generic, Typeable)
1000
1000
1001 -- This requires that index_options are set to 'offset' in the mapping.
1001 -- This requires that index_options are set to 'offset' in the mapping.
1002−data PostingsHighlight = PostingsHighlight (Maybe CommonHighlight) deriving (Show, Eq, Generic, Typeable)
1002+data PostingsHighlight = PostingsHighlight (Maybe CommonHighlight) deriving (Read, Show, Eq, Generic, Typeable)
1003
1003
1004-- This requires that term_vector is set to 'with_positions_offsets' in the mapping.
1004-- This requires that term_vector is set to 'with_positions_offsets' in the mapping.
1005data FastVectorHighlight =
1005data FastVectorHighlight =
@@ -1010,7 +1010,7 @@ data FastVectorHighlight =
1010 , fragmentOffset :: Maybe Int
1010 , fragmentOffset :: Maybe Int
1011 , matchedFields :: [Text]
1011 , matchedFields :: [Text]
1012 , phraseLimit :: Maybe Int
1012 , phraseLimit :: Maybe Int
1013− } deriving (Show, Eq, Generic, Typeable)
1013+ } deriving (Read, Show, Eq, Generic, Typeable)
1014
1014
1015data CommonHighlight =
1015data CommonHighlight =
1016 CommonHighlight { order :: Maybe Text
1016 CommonHighlight { order :: Maybe Text
@@ -1020,21 +1020,21 @@ data CommonHighlight =
1020 , noMatchSize :: Maybe Int
1020 , noMatchSize :: Maybe Int
1021 , highlightQuery :: Maybe Query
1021 , highlightQuery :: Maybe Query
1022 , requireFieldMatch :: Maybe Bool
1022 , requireFieldMatch :: Maybe Bool
1023− } deriving (Show, Eq, Generic, Typeable)
1023+ } deriving (Read, Show, Eq, Generic, Typeable)
1024
1024
1025-- Settings that are only applicable to FastVector and Plain highlighters.
1025-- Settings that are only applicable to FastVector and Plain highlighters.
1026data NonPostings =
1026data NonPostings =
1027 NonPostings { fragmentSize :: Maybe Int
1027 NonPostings { fragmentSize :: Maybe Int
1028− , numberOfFragments :: Maybe Int} deriving (Show, Eq, Generic, Typeable)
1028+ , numberOfFragments :: Maybe Int} deriving (Read, Show, Eq, Generic, Typeable)
1029
1029
1030data HighlightEncoder = DefaultEncoder
1030data HighlightEncoder = DefaultEncoder
1031 | HTMLEncoder
1031 | HTMLEncoder
1032− deriving (Show, Eq, Generic, Typeable)
1032+ deriving (Read, Show, Eq, Generic, Typeable)
1033
1033
1034-- NOTE: Should the tags use some kind of HTML type, rather than Text?
1034-- NOTE: Should the tags use some kind of HTML type, rather than Text?
1035data HighlightTag = TagSchema Text
1035data HighlightTag = TagSchema Text
1036 | CustomTags ([Text], [Text]) -- Only uses more than the first value in the lists if fvh
1036 | CustomTags ([Text], [Text]) -- Only uses more than the first value in the lists if fvh
1037− deriving (Show, Eq, Generic, Typeable)
1037+ deriving (Read, Show, Eq, Generic, Typeable)
1038
1038
1039
1039
1040data Query =
1040data Query =
@@ -1065,19 +1065,19 @@ data Query =
1065 | QuerySimpleQueryStringQuery SimpleQueryStringQuery
1065 | QuerySimpleQueryStringQuery SimpleQueryStringQuery
1066 | QueryRangeQuery RangeQuery
1066 | QueryRangeQuery RangeQuery
1067 | QueryRegexpQuery RegexpQuery
1067 | QueryRegexpQuery RegexpQuery
1068− deriving (Eq, Show, Generic, Typeable)
1068+ deriving (Eq, Read, Show, Generic, Typeable)
1069
1069
1070data RegexpQuery =
1070data RegexpQuery =
1071 RegexpQuery { regexpQueryField :: FieldName
1071 RegexpQuery { regexpQueryField :: FieldName
1072 , regexpQuery :: Regexp
1072 , regexpQuery :: Regexp
1073 , regexpQueryFlags :: RegexpFlags
1073 , regexpQueryFlags :: RegexpFlags
1074 , regexpQueryBoost :: Maybe Boost
1074 , regexpQueryBoost :: Maybe Boost
1075− } deriving (Eq, Show, Generic, Typeable)
1075+ } deriving (Eq, Read, Show, Generic, Typeable)
1076
1076
1077data RangeQuery =
1077data RangeQuery =
1078 RangeQuery { rangeQueryField :: FieldName
1078 RangeQuery { rangeQueryField :: FieldName
1079 , rangeQueryRange :: RangeValue
1079 , rangeQueryRange :: RangeValue
1080− , rangeQueryBoost :: Boost } deriving (Eq, Show, Generic, Typeable)
1080+ , rangeQueryBoost :: Boost } deriving (Eq, Read, Show, Generic, Typeable)
1081
1081
1082mkRangeQuery :: FieldName -> RangeValue -> RangeQuery
1082mkRangeQuery :: FieldName -> RangeValue -> RangeQuery
1083mkRangeQuery f r = RangeQuery f r (Boost 1.0)
1083mkRangeQuery f r = RangeQuery f r (Boost 1.0)
@@ -1091,7 +1091,7 @@ data SimpleQueryStringQuery =
1091 , simpleQueryStringFlags :: Maybe (NonEmpty SimpleQueryFlag)
1091 , simpleQueryStringFlags :: Maybe (NonEmpty SimpleQueryFlag)
1092 , simpleQueryStringLowercaseExpanded :: Maybe LowercaseExpanded
1092 , simpleQueryStringLowercaseExpanded :: Maybe LowercaseExpanded
1093 , simpleQueryStringLocale :: Maybe Locale
1093 , simpleQueryStringLocale :: Maybe Locale
1094− } deriving (Eq, Show, Generic, Typeable)
1094+ } deriving (Eq, Read, Show, Generic, Typeable)
1095
1095
1096data SimpleQueryFlag =
1096data SimpleQueryFlag =
1097 SimpleQueryAll
1097 SimpleQueryAll
@@ -1105,7 +1105,7 @@ data SimpleQueryFlag =
1105 | SimpleQueryWhitespace
1105 | SimpleQueryWhitespace
1106 | SimpleQueryFuzzy
1106 | SimpleQueryFuzzy
1107 | SimpleQueryNear
1107 | SimpleQueryNear
1108− | SimpleQuerySlop deriving (Eq, Show, Generic, Typeable)
1108+ | SimpleQuerySlop deriving (Eq, Read, Show, Generic, Typeable)
1109
1109
1110-- use_dis_max and tie_breaker when fields are plural?
1110-- use_dis_max and tie_breaker when fields are plural?
1111data QueryStringQuery =
1111data QueryStringQuery =
@@ -1127,7 +1127,7 @@ data QueryStringQuery =
1127 , queryStringMinimumShouldMatch :: Maybe MinimumMatch
1127 , queryStringMinimumShouldMatch :: Maybe MinimumMatch
1128 , queryStringLenient :: Maybe Lenient
1128 , queryStringLenient :: Maybe Lenient
1129 , queryStringLocale :: Maybe Locale
1129 , queryStringLocale :: Maybe Locale
1130− } deriving (Eq, Show, Generic, Typeable)
1130+ } deriving (Eq, Read, Show, Generic, Typeable)
1131
1131
1132mkQueryStringQuery :: QueryString -> QueryStringQuery
1132mkQueryStringQuery :: QueryString -> QueryStringQuery
1133mkQueryStringQuery qs =
1133mkQueryStringQuery qs =
@@ -1138,19 +1138,19 @@ mkQueryStringQuery qs =
1138 Nothing Nothing
1138 Nothing Nothing
1139
1139
1140data FieldOrFields = FofField FieldName
1140data FieldOrFields = FofField FieldName
1141− | FofFields (NonEmpty FieldName) deriving (Eq, Show, Generic, Typeable)
1141+ | FofFields (NonEmpty FieldName) deriving (Eq, Read, Show, Generic, Typeable)
1142
1142
1143data PrefixQuery =
1143data PrefixQuery =
1144 PrefixQuery
1144 PrefixQuery
1145 { prefixQueryField :: FieldName
1145 { prefixQueryField :: FieldName
1146 , prefixQueryPrefixValue :: Text
1146 , prefixQueryPrefixValue :: Text
1147− , prefixQueryBoost :: Maybe Boost } deriving (Eq, Show, Generic, Typeable)
1147+ , prefixQueryBoost :: Maybe Boost } deriving (Eq, Read, Show, Generic, Typeable)
1148
1148
1149data NestedQuery =
1149data NestedQuery =
1150 NestedQuery
1150 NestedQuery
1151 { nestedQueryPath :: QueryPath
1151 { nestedQueryPath :: QueryPath
1152 , nestedQueryScoreType :: ScoreType
1152 , nestedQueryScoreType :: ScoreType
1153− , nestedQuery :: Query } deriving (Eq, Show, Generic, Typeable)
1153+ , nestedQuery :: Query } deriving (Eq, Read, Show, Generic, Typeable)
1154
1154
1155data MoreLikeThisFieldQuery =
1155data MoreLikeThisFieldQuery =
1156 MoreLikeThisFieldQuery
1156 MoreLikeThisFieldQuery
@@ -1168,7 +1168,7 @@ data MoreLikeThisFieldQuery =
1168 , moreLikeThisFieldBoostTerms :: Maybe BoostTerms
1168 , moreLikeThisFieldBoostTerms :: Maybe BoostTerms
1169 , moreLikeThisFieldBoost :: Maybe Boost
1169 , moreLikeThisFieldBoost :: Maybe Boost
1170 , moreLikeThisFieldAnalyzer :: Maybe Analyzer
1170 , moreLikeThisFieldAnalyzer :: Maybe Analyzer
1171− } deriving (Eq, Show, Generic, Typeable)
1171+ } deriving (Eq, Read, Show, Generic, Typeable)
1172
1172
1173data MoreLikeThisQuery =
1173data MoreLikeThisQuery =
1174 MoreLikeThisQuery
1174 MoreLikeThisQuery
@@ -1186,32 +1186,32 @@ data MoreLikeThisQuery =
1186 , moreLikeThisBoostTerms :: Maybe BoostTerms
1186 , moreLikeThisBoostTerms :: Maybe BoostTerms
1187 , moreLikeThisBoost :: Maybe Boost
1187 , moreLikeThisBoost :: Maybe Boost
1188 , moreLikeThisAnalyzer :: Maybe Analyzer
1188 , moreLikeThisAnalyzer :: Maybe Analyzer
1189− } deriving (Eq, Show, Generic, Typeable)
1189+ } deriving (Eq, Read, Show, Generic, Typeable)
1190
1190
1191data IndicesQuery =
1191data IndicesQuery =
1192 IndicesQuery
1192 IndicesQuery
1193 { indicesQueryIndices :: [IndexName]
1193 { indicesQueryIndices :: [IndexName]
1194 , indicesQuery :: Query
1194 , indicesQuery :: Query
1195 -- default "all"
1195 -- default "all"
1196− , indicesQueryNoMatch :: Maybe Query } deriving (Eq, Show, Generic, Typeable)
1196+ , indicesQueryNoMatch :: Maybe Query } deriving (Eq, Read, Show, Generic, Typeable)
1197
1197
1198data HasParentQuery =
1198data HasParentQuery =
1199 HasParentQuery
1199 HasParentQuery
1200 { hasParentQueryType :: TypeName
1200 { hasParentQueryType :: TypeName
1201 , hasParentQuery :: Query
1201 , hasParentQuery :: Query
1202− , hasParentQueryScoreType :: Maybe ScoreType } deriving (Eq, Show, Generic, Typeable)
1202+ , hasParentQueryScoreType :: Maybe ScoreType } deriving (Eq, Read, Show, Generic, Typeable)
1203
1203
1204data HasChildQuery =
1204data HasChildQuery =
1205 HasChildQuery
1205 HasChildQuery
1206 { hasChildQueryType :: TypeName
1206 { hasChildQueryType :: TypeName
1207 , hasChildQuery :: Query
1207 , hasChildQuery :: Query
1208− , hasChildQueryScoreType :: Maybe ScoreType } deriving (Eq, Show, Generic, Typeable)
1208+ , hasChildQueryScoreType :: Maybe ScoreType } deriving (Eq, Read, Show, Generic, Typeable)
1209
1209
1210data ScoreType =
1210data ScoreType =
1211 ScoreTypeMax
1211 ScoreTypeMax
1212 | ScoreTypeSum
1212 | ScoreTypeSum
1213 | ScoreTypeAvg
1213 | ScoreTypeAvg
1214− | ScoreTypeNone deriving (Eq, Show, Generic, Typeable)
1214+ | ScoreTypeNone deriving (Eq, Read, Show, Generic, Typeable)
1215
1215
1216data FuzzyQuery =
1216data FuzzyQuery =
1217 FuzzyQuery { fuzzyQueryField :: FieldName
1217 FuzzyQuery { fuzzyQueryField :: FieldName
@@ -1220,7 +1220,7 @@ data FuzzyQuery =
1220 , fuzzyQueryMaxExpansions :: MaxExpansions
1220 , fuzzyQueryMaxExpansions :: MaxExpansions
1221 , fuzzyQueryFuzziness :: Fuzziness
1221 , fuzzyQueryFuzziness :: Fuzziness
1222 , fuzzyQueryBoost :: Maybe Boost
1222 , fuzzyQueryBoost :: Maybe Boost
1223− } deriving (Eq, Show, Generic, Typeable)
1223+ } deriving (Eq, Read, Show, Generic, Typeable)
1224
1224
1225data FuzzyLikeFieldQuery =
1225data FuzzyLikeFieldQuery =
1226 FuzzyLikeFieldQuery
1226 FuzzyLikeFieldQuery
@@ -1233,7 +1233,7 @@ data FuzzyLikeFieldQuery =
1233 , fuzzyLikeFieldPrefixLength :: PrefixLength
1233 , fuzzyLikeFieldPrefixLength :: PrefixLength
1234 , fuzzyLikeFieldBoost :: Boost
1234 , fuzzyLikeFieldBoost :: Boost
1235 , fuzzyLikeFieldAnalyzer :: Maybe Analyzer
1235 , fuzzyLikeFieldAnalyzer :: Maybe Analyzer
1236− } deriving (Eq, Show, Generic, Typeable)
1236+ } deriving (Eq, Read, Show, Generic, Typeable)
1237
1237
1238data FuzzyLikeThisQuery =
1238data FuzzyLikeThisQuery =
1239 FuzzyLikeThisQuery
1239 FuzzyLikeThisQuery
@@ -1245,19 +1245,19 @@ data FuzzyLikeThisQuery =
1245 , fuzzyLikePrefixLength :: PrefixLength
1245 , fuzzyLikePrefixLength :: PrefixLength
1246 , fuzzyLikeBoost :: Boost
1246 , fuzzyLikeBoost :: Boost
1247 , fuzzyLikeAnalyzer :: Maybe Analyzer
1247 , fuzzyLikeAnalyzer :: Maybe Analyzer
1248− } deriving (Eq, Show, Generic, Typeable)
1248+ } deriving (Eq, Read, Show, Generic, Typeable)
1249
1249
1250data FilteredQuery =
1250data FilteredQuery =
1251 FilteredQuery
1251 FilteredQuery
1252 { filteredQuery :: Query
1252 { filteredQuery :: Query
1253− , filteredFilter :: Filter } deriving (Eq, Show, Generic, Typeable)
1253+ , filteredFilter :: Filter } deriving (Eq, Read, Show, Generic, Typeable)
1254
1254
1255data DisMaxQuery =
1255data DisMaxQuery =
1256 DisMaxQuery { disMaxQueries :: [Query]
1256 DisMaxQuery { disMaxQueries :: [Query]
1257 -- default 0.0
1257 -- default 0.0
1258 , disMaxTiebreaker :: Tiebreaker
1258 , disMaxTiebreaker :: Tiebreaker
1259 , disMaxBoost :: Maybe Boost
1259 , disMaxBoost :: Maybe Boost
1260− } deriving (Eq, Show, Generic, Typeable)
1260+ } deriving (Eq, Read, Show, Generic, Typeable)
1261
1261
1262data MatchQuery =
1262data MatchQuery =
1263 MatchQuery { matchQueryField :: FieldName
1263 MatchQuery { matchQueryField :: FieldName
@@ -1269,7 +1269,7 @@ data MatchQuery =
1269 , matchQueryAnalyzer :: Maybe Analyzer
1269 , matchQueryAnalyzer :: Maybe Analyzer
1270 , matchQueryMaxExpansions :: Maybe MaxExpansions
1270 , matchQueryMaxExpansions :: Maybe MaxExpansions
1271 , matchQueryLenient :: Maybe Lenient
1271 , matchQueryLenient :: Maybe Lenient
1272− , matchQueryBoost :: Maybe Boost } deriving (Eq, Show, Generic, Typeable)
1272+ , matchQueryBoost :: Maybe Boost } deriving (Eq, Read, Show, Generic, Typeable)
1273
1273
1274{-| 'mkMatchQuery' is a convenience function that defaults the less common parameters,
1274{-| 'mkMatchQuery' is a convenience function that defaults the less common parameters,
1275 enabling you to provide only the 'FieldName' and 'QueryString' to make a 'MatchQuery'
1275 enabling you to provide only the 'FieldName' and 'QueryString' to make a 'MatchQuery'
@@ -1279,7 +1279,7 @@ mkMatchQuery field query = MatchQuery field query Or ZeroTermsNone Nothing Nothi
1279
1279
1280data MatchQueryType =
1280data MatchQueryType =
1281 MatchPhrase
1281 MatchPhrase
1282− | MatchPhrasePrefix deriving (Eq, Show, Generic, Typeable)
1282+ | MatchPhrasePrefix deriving (Eq, Read, Show, Generic, Typeable)
1283
1283
1284data MultiMatchQuery =
1284data MultiMatchQuery =
1285 MultiMatchQuery { multiMatchQueryFields :: [FieldName]
1285 MultiMatchQuery { multiMatchQueryFields :: [FieldName]
@@ -1291,7 +1291,7 @@ data MultiMatchQuery =
1291 , multiMatchQueryCutoffFrequency :: Maybe CutoffFrequency
1291 , multiMatchQueryCutoffFrequency :: Maybe CutoffFrequency
1292 , multiMatchQueryAnalyzer :: Maybe Analyzer
1292 , multiMatchQueryAnalyzer :: Maybe Analyzer
1293 , multiMatchQueryMaxExpansions :: Maybe MaxExpansions
1293 , multiMatchQueryMaxExpansions :: Maybe MaxExpansions
1294− , multiMatchQueryLenient :: Maybe Lenient } deriving (Eq, Show, Generic, Typeable)
1294+ , multiMatchQueryLenient :: Maybe Lenient } deriving (Eq, Read, Show, Generic, Typeable)
1295
1295
1296{-| 'mkMultiMatchQuery' is a convenience function that defaults the less common parameters,
1296{-| 'mkMultiMatchQuery' is a convenience function that defaults the less common parameters,
1297 enabling you to provide only the list of 'FieldName's and 'QueryString' to
1297 enabling you to provide only the list of 'FieldName's and 'QueryString' to
@@ -1308,7 +1308,7 @@ data MultiMatchQueryType =
1308 | MultiMatchMostFields
1308 | MultiMatchMostFields
1309 | MultiMatchCrossFields
1309 | MultiMatchCrossFields
1310 | MultiMatchPhrase
1310 | MultiMatchPhrase
1311− | MultiMatchPhrasePrefix deriving (Eq, Show, Generic, Typeable)
1311+ | MultiMatchPhrasePrefix deriving (Eq, Read, Show, Generic, Typeable)
1312
1312
1313data BoolQuery =
1313data BoolQuery =
1314 BoolQuery { boolQueryMustMatch :: [Query]
1314 BoolQuery { boolQueryMustMatch :: [Query]
@@ -1317,7 +1317,7 @@ data BoolQuery =
1317 , boolQueryMinimumShouldMatch :: Maybe MinimumMatch
1317 , boolQueryMinimumShouldMatch :: Maybe MinimumMatch
1318 , boolQueryBoost :: Maybe Boost
1318 , boolQueryBoost :: Maybe Boost
1319 , boolQueryDisableCoord :: Maybe DisableCoord
1319 , boolQueryDisableCoord :: Maybe DisableCoord
1320− } deriving (Eq, Show, Generic, Typeable)
1320+ } deriving (Eq, Read, Show, Generic, Typeable)
1321
1321
1322mkBoolQuery :: [Query] -> [Query] -> [Query] -> BoolQuery
1322mkBoolQuery :: [Query] -> [Query] -> [Query] -> BoolQuery
1323mkBoolQuery must mustNot should =
1323mkBoolQuery must mustNot should =
@@ -1326,7 +1326,7 @@ mkBoolQuery must mustNot should =
1326data BoostingQuery =
1326data BoostingQuery =
1327 BoostingQuery { positiveQuery :: Query
1327 BoostingQuery { positiveQuery :: Query
1328 , negativeQuery :: Query
1328 , negativeQuery :: Query
1329− , negativeBoost :: Boost } deriving (Eq, Show, Generic, Typeable)
1329+ , negativeBoost :: Boost } deriving (Eq, Read, Show, Generic, Typeable)
1330
1330
1331data CommonTermsQuery =
1331data CommonTermsQuery =
1332 CommonTermsQuery { commonField :: FieldName
1332 CommonTermsQuery { commonField :: FieldName
@@ -1338,16 +1338,16 @@ data CommonTermsQuery =
1338 , commonBoost :: Maybe Boost
1338 , commonBoost :: Maybe Boost
1339 , commonAnalyzer :: Maybe Analyzer
1339 , commonAnalyzer :: Maybe Analyzer
1340 , commonDisableCoord :: Maybe DisableCoord
1340 , commonDisableCoord :: Maybe DisableCoord
1341− } deriving (Eq, Show, Generic, Typeable)
1341+ } deriving (Eq, Read, Show, Generic, Typeable)
1342
1342
1343data CommonMinimumMatch =
1343data CommonMinimumMatch =
1344 CommonMinimumMatchHighLow MinimumMatchHighLow
1344 CommonMinimumMatchHighLow MinimumMatchHighLow
1345 | CommonMinimumMatch MinimumMatch
1345 | CommonMinimumMatch MinimumMatch
1346− deriving (Eq, Show, Generic, Typeable)
1346+ deriving (Eq, Read, Show, Generic, Typeable)
1347
1347
1348data MinimumMatchHighLow =
1348data MinimumMatchHighLow =
1349 MinimumMatchHighLow { lowFreq :: MinimumMatch
1349 MinimumMatchHighLow { lowFreq :: MinimumMatch
1350− , highFreq :: MinimumMatch } deriving (Eq, Show, Generic, Typeable)
1350+ , highFreq :: MinimumMatch } deriving (Eq, Read, Show, Generic, Typeable)
1351
1351
1352data Filter = AndFilter [Filter] Cache
1352data Filter = AndFilter [Filter] Cache
1353 | OrFilter [Filter] Cache
1353 | OrFilter [Filter] Cache
@@ -1367,36 +1367,36 @@ data Filter = AndFilter [Filter] Cache
1367 | RangeFilter FieldName RangeValue RangeExecution Cache
1367 | RangeFilter FieldName RangeValue RangeExecution Cache
1368 | RegexpFilter FieldName Regexp RegexpFlags CacheName Cache CacheKey
1368 | RegexpFilter FieldName Regexp RegexpFlags CacheName Cache CacheKey
1369 | TermFilter Term Cache
1369 | TermFilter Term Cache
1370− deriving (Eq, Show, Generic, Typeable)
1370+ deriving (Eq, Read, Show, Generic, Typeable)
1371
1371
1372data ZeroTermsQuery = ZeroTermsNone
1372data ZeroTermsQuery = ZeroTermsNone
1373− | ZeroTermsAll deriving (Eq, Show, Generic, Typeable)
1373+ | ZeroTermsAll deriving (Eq, Read, Show, Generic, Typeable)
1374
1374
1375data RangeExecution = RangeExecutionIndex
1375data RangeExecution = RangeExecutionIndex
1376− | RangeExecutionFielddata deriving (Eq, Show, Generic, Typeable)
1376+ | RangeExecutionFielddata deriving (Eq, Read, Show, Generic, Typeable)
1377
1377
1378−newtype Regexp = Regexp Text deriving (Eq, Show, Generic, Typeable, FromJSON)
1378+newtype Regexp = Regexp Text deriving (Eq, Read, Show, Generic, Typeable, FromJSON)
1379
1379
1380data RegexpFlags = AllRegexpFlags
1380data RegexpFlags = AllRegexpFlags
1381 | NoRegexpFlags
1381 | NoRegexpFlags
1382− | SomeRegexpFlags (NonEmpty RegexpFlag) deriving (Eq, Show, Generic, Typeable)
1382+ | SomeRegexpFlags (NonEmpty RegexpFlag) deriving (Eq, Read, Show, Generic, Typeable)
1383
1383
1384data RegexpFlag = AnyString
1384data RegexpFlag = AnyString
1385 | Automaton
1385 | Automaton
1386 | Complement
1386 | Complement
1387 | Empty
1387 | Empty
1388 | Intersection
1388 | Intersection
1389− | Interval deriving (Eq, Show, Generic, Typeable)
1389+ | Interval deriving (Eq, Read, Show, Generic, Typeable)
1390
1390
1391−newtype LessThan = LessThan Double deriving (Eq, Show, Generic, Typeable)
1391+newtype LessThan = LessThan Double deriving (Eq, Read, Show, Generic, Typeable)
1392−newtype LessThanEq = LessThanEq Double deriving (Eq, Show, Generic, Typeable)
1392+newtype LessThanEq = LessThanEq Double deriving (Eq, Read, Show, Generic, Typeable)
1393−newtype GreaterThan = GreaterThan Double deriving (Eq, Show, Generic, Typeable)
1393+newtype GreaterThan = GreaterThan Double deriving (Eq, Read, Show, Generic, Typeable)
1394−newtype GreaterThanEq = GreaterThanEq Double deriving (Eq, Show, Generic, Typeable)
1394+newtype GreaterThanEq = GreaterThanEq Double deriving (Eq, Read, Show, Generic, Typeable)
1395
1395
1396−newtype LessThanD = LessThanD UTCTime deriving (Eq, Show, Generic, Typeable)
1396+newtype LessThanD = LessThanD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
1397−newtype LessThanEqD = LessThanEqD UTCTime deriving (Eq, Show, Generic, Typeable)
1397+newtype LessThanEqD = LessThanEqD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
1398−newtype GreaterThanD = GreaterThanD UTCTime deriving (Eq, Show, Generic, Typeable)
1398+newtype GreaterThanD = GreaterThanD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
1399−newtype GreaterThanEqD = GreaterThanEqD UTCTime deriving (Eq, Show, Generic, Typeable)
1399+newtype GreaterThanEqD = GreaterThanEqD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
1400
1400
1401data RangeValue = RangeDateLte LessThanEqD
1401data RangeValue = RangeDateLte LessThanEqD
1402 | RangeDateLt LessThanD
1402 | RangeDateLt LessThanD
@@ -1414,7 +1414,7 @@ data RangeValue = RangeDateLte LessThanEqD
1414 | RangeDoubleGteLte GreaterThanEq LessThanEq
1414 | RangeDoubleGteLte GreaterThanEq LessThanEq
1415 | RangeDoubleGteLt GreaterThanEq LessThan
1415 | RangeDoubleGteLt GreaterThanEq LessThan
1416 | RangeDoubleGtLte GreaterThan LessThanEq
1416 | RangeDoubleGtLte GreaterThan LessThanEq
1417− deriving (Eq, Show, Generic, Typeable)
1417+ deriving (Eq, Read, Show, Generic, Typeable)
1418
1418
1419rangeValueToPair :: RangeValue -> [Pair]
1419rangeValueToPair :: RangeValue -> [Pair]
1420rangeValueToPair rv = case rv of
1420rangeValueToPair rv = case rv of
@@ -1436,33 +1436,33 @@ rangeValueToPair rv = case rv of
1436 RangeDoubleGtLt (GreaterThan l) (LessThan g) -> ["gt" .= l, "lt" .= g]
1436 RangeDoubleGtLt (GreaterThan l) (LessThan g) -> ["gt" .= l, "lt" .= g]
1437
1437
1438data Term = Term { termField :: Text
1438data Term = Term { termField :: Text
1439− , termValue :: Text } deriving (Eq, Show, Generic, Typeable)
1439+ , termValue :: Text } deriving (Eq, Read, Show, Generic, Typeable)
1440
1440
1441data BoolMatch = MustMatch Term Cache
1441data BoolMatch = MustMatch Term Cache
1442 | MustNotMatch Term Cache
1442 | MustNotMatch Term Cache
1443− | ShouldMatch [Term] Cache deriving (Eq, Show, Generic, Typeable)
1443+ | ShouldMatch [Term] Cache deriving (Eq, Read, Show, Generic, Typeable)
1444
1444
1445-- "memory" or "indexed"
1445-- "memory" or "indexed"
1446data GeoFilterType = GeoFilterMemory
1446data GeoFilterType = GeoFilterMemory
1447− | GeoFilterIndexed deriving (Eq, Show, Generic, Typeable)
1447+ | GeoFilterIndexed deriving (Eq, Read, Show, Generic, Typeable)
1448
1448
1449data LatLon = LatLon { lat :: Double
1449data LatLon = LatLon { lat :: Double
1450− , lon :: Double } deriving (Eq, Show, Generic, Typeable)
1450+ , lon :: Double } deriving (Eq, Read, Show, Generic, Typeable)
1451
1451
1452data GeoBoundingBox =
1452data GeoBoundingBox =
1453 GeoBoundingBox { topLeft :: LatLon
1453 GeoBoundingBox { topLeft :: LatLon
1454− , bottomRight :: LatLon } deriving (Eq, Show, Generic, Typeable)
1454+ , bottomRight :: LatLon } deriving (Eq, Read, Show, Generic, Typeable)
1455
1455
1456data GeoBoundingBoxConstraint =
1456data GeoBoundingBoxConstraint =
1457 GeoBoundingBoxConstraint { geoBBField :: FieldName
1457 GeoBoundingBoxConstraint { geoBBField :: FieldName
1458 , constraintBox :: GeoBoundingBox
1458 , constraintBox :: GeoBoundingBox
1459 , bbConstraintcache :: Cache
1459 , bbConstraintcache :: Cache
1460 , geoType :: GeoFilterType
1460 , geoType :: GeoFilterType
1461− } deriving (Eq, Show, Generic, Typeable)
1461+ } deriving (Eq, Read, Show, Generic, Typeable)
1462
1462
1463data GeoPoint =
1463data GeoPoint =
1464 GeoPoint { geoField :: FieldName
1464 GeoPoint { geoField :: FieldName
1465− , latLon :: LatLon} deriving (Eq, Show, Generic, Typeable)
1465+ , latLon :: LatLon} deriving (Eq, Read, Show, Generic, Typeable)
1466
1466
1467data DistanceUnit = Miles
1467data DistanceUnit = Miles
1468 | Yards
1468 | Yards
@@ -1472,22 +1472,22 @@ data DistanceUnit = Miles
1472 | Meters
1472 | Meters
1473 | Centimeters
1473 | Centimeters
1474 | Millimeters
1474 | Millimeters
1475− | NauticalMiles deriving (Eq, Show, Generic, Typeable)
1475+ | NauticalMiles deriving (Eq, Read, Show, Generic, Typeable)
1476
1476
1477data DistanceType = Arc
1477data DistanceType = Arc
1478 | SloppyArc -- doesn't exist <1.0
1478 | SloppyArc -- doesn't exist <1.0
1479− | Plane deriving (Eq, Show, Generic, Typeable)
1479+ | Plane deriving (Eq, Read, Show, Generic, Typeable)
1480
1480
1481data OptimizeBbox = OptimizeGeoFilterType GeoFilterType
1481data OptimizeBbox = OptimizeGeoFilterType GeoFilterType
1482− | NoOptimizeBbox deriving (Eq, Show, Generic, Typeable)
1482+ | NoOptimizeBbox deriving (Eq, Read, Show, Generic, Typeable)
1483
1483
1484data Distance =
1484data Distance =
1485 Distance { coefficient :: Double
1485 Distance { coefficient :: Double
1486− , unit :: DistanceUnit } deriving (Eq, Show, Generic, Typeable)
1486+ , unit :: DistanceUnit } deriving (Eq, Read, Show, Generic, Typeable)
1487
1487
1488data DistanceRange =
1488data DistanceRange =
1489 DistanceRange { distanceFrom :: Distance
1489 DistanceRange { distanceFrom :: Distance
1490− , distanceTo :: Distance } deriving (Eq, Show, Generic, Typeable)
1490+ , distanceTo :: Distance } deriving (Eq, Read, Show, Generic, Typeable)
1491
1491
1492data SearchResult a =
1492data SearchResult a =
1493 SearchResult { took :: Int
1493 SearchResult { took :: Int
@@ -1495,16 +1495,16 @@ data SearchResult a =
1495 , shards :: ShardResult
1495 , shards :: ShardResult
1496 , searchHits :: SearchHits a
1496 , searchHits :: SearchHits a
1497 , aggregations :: Maybe AggregationResults
1497 , aggregations :: Maybe AggregationResults
1498− , scrollId :: Maybe ScrollId } deriving (Eq, Show, Generic, Typeable)
1498+ , scrollId :: Maybe ScrollId } deriving (Eq, Read, Show, Generic, Typeable)
1499
1499
1500−newtype ScrollId = ScrollId Text deriving (Eq, Show, Generic, Ord, ToJSON, FromJSON)
1500+newtype ScrollId = ScrollId Text deriving (Eq, Read, Show, Generic, Ord, ToJSON, FromJSON)
1501
1501
1502type Score = Maybe Double
1502type Score = Maybe Double
1503
1503
1504data SearchHits a =
1504data SearchHits a =
1505 SearchHits { hitsTotal :: Int
1505 SearchHits { hitsTotal :: Int
1506 , maxScore :: Score
1506 , maxScore :: Score
1507− , hits :: [Hit a] } deriving (Eq, Show, Generic, Typeable)
1507+ , hits :: [Hit a] } deriving (Eq, Read, Show, Generic, Typeable)
1508
1508
1509
1509
1510instance Monoid (SearchHits a) where
1510instance Monoid (SearchHits a) where
@@ -1519,12 +1519,12 @@ data Hit a =
1519 , hitDocId :: DocId
1519 , hitDocId :: DocId
1520 , hitScore :: Score
1520 , hitScore :: Score
1521 , hitSource :: Maybe a
1521 , hitSource :: Maybe a
1522− , hitHighlight :: Maybe HitHighlight } deriving (Eq, Show, Generic, Typeable)
1522+ , hitHighlight :: Maybe HitHighlight } deriving (Eq, Read, Show, Generic, Typeable)
1523
1523
1524data ShardResult =
1524data ShardResult =
1525 ShardResult { shardTotal :: Int
1525 ShardResult { shardTotal :: Int
1526 , shardsSuccessful :: Int
1526 , shardsSuccessful :: Int
1527− , shardsFailed :: Int } deriving (Eq, Show, Generic, Typeable)
1527+ , shardsFailed :: Int } deriving (Eq, Read, Show, Generic, Typeable)
1528
1528
1529type HitHighlight = M.Map Text [Text]
1529type HitHighlight = M.Map Text [Text]
1530
1530
@@ -1548,25 +1548,25 @@ mkAggregations :: Text -> Aggregation -> Aggregations
1548mkAggregations name aggregation = M.insert name aggregation emptyAggregations
1548mkAggregations name aggregation = M.insert name aggregation emptyAggregations
1549
1549
1550data TermOrder = TermOrder{ termSortField :: Text
1550data TermOrder = TermOrder{ termSortField :: Text
1551− , termSortOrder :: SortOrder } deriving (Eq, Show, Generic, Typeable)
1551+ , termSortOrder :: SortOrder } deriving (Eq, Read, Show, Generic, Typeable)
1552
1552
1553data TermInclusion = TermInclusion Text
1553data TermInclusion = TermInclusion Text
1554− | TermPattern Text Text deriving (Eq, Show, Generic, Typeable)
1554+ | TermPattern Text Text deriving (Eq, Read, Show, Generic, Typeable)
1555
1555
1556data CollectionMode = BreadthFirst
1556data CollectionMode = BreadthFirst
1557− | DepthFirst deriving (Eq, Show, Generic, Typeable)
1557+ | DepthFirst deriving (Eq, Read, Show, Generic, Typeable)
1558
1558
1559data ExecutionHint = Ordinals
1559data ExecutionHint = Ordinals
1560 | GlobalOrdinals
1560 | GlobalOrdinals
1561 | GlobalOrdinalsHash
1561 | GlobalOrdinalsHash
1562 | GlobalOrdinalsLowCardinality
1562 | GlobalOrdinalsLowCardinality
1563− | Map deriving (Eq, Show, Generic, Typeable)
1563+ | Map deriving (Eq, Read, Show, Generic, Typeable)
1564
1564
1565data TimeInterval = Weeks
1565data TimeInterval = Weeks
1566 | Days
1566 | Days
1567 | Hours
1567 | Hours
1568 | Minutes
1568 | Minutes
1569− | Seconds deriving (Eq)
1569+ | Seconds deriving (Eq, Read)
1570
1570
1571data Interval = Year
1571data Interval = Year
1572 | Quarter
1572 | Quarter
@@ -1576,18 +1576,18 @@ data Interval = Year
1576 | Hour
1576 | Hour
1577 | Minute
1577 | Minute
1578 | Second
1578 | Second
1579− | FractionalInterval Float TimeInterval deriving (Eq, Show, Generic, Typeable)
1579+ | FractionalInterval Float TimeInterval deriving (Eq, Read, Show, Generic, Typeable)
1580
1580
1581data Aggregation = TermsAgg TermsAggregation
1581data Aggregation = TermsAgg TermsAggregation
1582 | DateHistogramAgg DateHistogramAggregation
1582 | DateHistogramAgg DateHistogramAggregation
1583 | ValueCountAgg ValueCountAggregation
1583 | ValueCountAgg ValueCountAggregation
1584 | FilterAgg FilterAggregation
1584 | FilterAgg FilterAggregation
1585 | DateRangeAgg DateRangeAggregation
1585 | DateRangeAgg DateRangeAggregation
1586− | MissingAgg MissingAggregation deriving (Eq, Show, Generic, Typeable)
1586+ | MissingAgg MissingAggregation deriving (Eq, Read, Show, Generic, Typeable)
1587
1587
1588data MissingAggregation = MissingAggregation
1588data MissingAggregation = MissingAggregation
1589 { maField :: Text
1589 { maField :: Text
1590− } deriving (Eq, Show, Generic, Typeable)
1590+ } deriving (Eq, Read, Show, Generic, Typeable)
1591
1591
1592data TermsAggregation = TermsAggregation { term :: Either Text Text
1592data TermsAggregation = TermsAggregation { term :: Either Text Text
1593 , termInclude :: Maybe TermInclusion
1593 , termInclude :: Maybe TermInclusion
@@ -1599,7 +1599,7 @@ data TermsAggregation = TermsAggregation { term :: Either Text Text
1599 , termCollectMode :: Maybe CollectionMode
1599 , termCollectMode :: Maybe CollectionMode
1600 , termExecutionHint :: Maybe ExecutionHint
1600 , termExecutionHint :: Maybe ExecutionHint
1601 , termAggs :: Maybe Aggregations
1601 , termAggs :: Maybe Aggregations
1602− } deriving (Eq, Show, Generic, Typeable)
1602+ } deriving (Eq, Read, Show, Generic, Typeable)
1603
1603
1604data DateHistogramAggregation = DateHistogramAggregation { dateField :: FieldName
1604data DateHistogramAggregation = DateHistogramAggregation { dateField :: FieldName
1605 , dateInterval :: Interval
1605 , dateInterval :: Interval
@@ -1610,29 +1610,29 @@ data DateHistogramAggregation = DateHistogramAggregation { dateField :: Fie
1610 , datePreOffset :: Maybe Text
1610 , datePreOffset :: Maybe Text
1611 , datePostOffset :: Maybe Text
1611 , datePostOffset :: Maybe Text
1612 , dateAggs :: Maybe Aggregations
1612 , dateAggs :: Maybe Aggregations
1613− } deriving (Eq, Show, Generic, Typeable)
1613+ } deriving (Eq, Read, Show, Generic, Typeable)
1614
1614
1615
1615
1616data DateRangeAggregation = DateRangeAggregation { draField :: FieldName
1616data DateRangeAggregation = DateRangeAggregation { draField :: FieldName
1617 , draFormat :: Maybe Text
1617 , draFormat :: Maybe Text
1618 , draRanges :: NonEmpty DateRangeAggRange
1618 , draRanges :: NonEmpty DateRangeAggRange
1619− } deriving (Eq, Show, Generic, Typeable)
1619+ } deriving (Eq, Read, Show, Generic, Typeable)
1620
1620
1621data DateRangeAggRange = DateRangeFrom DateMathExpr
1621data DateRangeAggRange = DateRangeFrom DateMathExpr
1622 | DateRangeTo DateMathExpr
1622 | DateRangeTo DateMathExpr
1623− | DateRangeFromAndTo DateMathExpr DateMathExpr deriving (Eq, Show, Generic, Typeable)
1623+ | DateRangeFromAndTo DateMathExpr DateMathExpr deriving (Eq, Read, Show, Generic, Typeable)
1624
1624
1625-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math> for more information.
1625-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math> for more information.
1626−data DateMathExpr = DateMathExpr DateMathAnchor [DateMathModifier] deriving (Eq, Show, Generic, Typeable)
1626+data DateMathExpr = DateMathExpr DateMathAnchor [DateMathModifier] deriving (Eq, Read, Show, Generic, Typeable)
1627
1627
1628
1628
1629-- | Starting point for a date range. This along with the 'DateMathModifiers' gets you the date ES will start from.
1629-- | Starting point for a date range. This along with the 'DateMathModifiers' gets you the date ES will start from.
1630data DateMathAnchor = DMNow
1630data DateMathAnchor = DMNow
1631− | DMDate Day deriving (Eq, Show, Generic, Typeable)
1631+ | DMDate Day deriving (Eq, Read, Show, Generic, Typeable)
1632
1632
1633data DateMathModifier = AddTime Int DateMathUnit
1633data DateMathModifier = AddTime Int DateMathUnit
1634 | SubtractTime Int DateMathUnit
1634 | SubtractTime Int DateMathUnit
1635− | RoundDownTo DateMathUnit deriving (Eq, Show, Generic, Typeable)
1635+ | RoundDownTo DateMathUnit deriving (Eq, Read, Show, Generic, Typeable)
1636
1636
1637data DateMathUnit = DMYear
1637data DateMathUnit = DMYear
1638 | DMMonth
1638 | DMMonth
@@ -1640,15 +1640,15 @@ data DateMathUnit = DMYear
1640 | DMDay
1640 | DMDay
1641 | DMHour
1641 | DMHour
1642 | DMMinute
1642 | DMMinute
1643− | DMSecond deriving (Eq, Show, Generic, Typeable)
1643+ | DMSecond deriving (Eq, Read, Show, Generic, Typeable)
1644
1644
1645-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html> for more information.
1645-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html> for more information.
1646data ValueCountAggregation = FieldValueCount FieldName
1646data ValueCountAggregation = FieldValueCount FieldName
1647− | ScriptValueCount Script deriving (Eq, Show, Generic, Typeable)
1647+ | ScriptValueCount Script deriving (Eq, Read, Show, Generic, Typeable)
1648
1648
1649-- | 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.
1649-- | 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.
1650data FilterAggregation = FilterAggregation { faFilter :: Filter
1650data FilterAggregation = FilterAggregation { faFilter :: Filter
1651− , faAggs :: Maybe Aggregations} deriving (Eq, Show, Generic, Typeable)
1651+ , faAggs :: Maybe Aggregations} deriving (Eq, Read, Show, Generic, Typeable)
1652
1652
1653mkTermsAggregation :: Text -> TermsAggregation
1653mkTermsAggregation :: Text -> TermsAggregation
1654mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
1654mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
@@ -1789,22 +1789,22 @@ class BucketAggregation a where
1789 aggs :: a -> Maybe AggregationResults
1789 aggs :: a -> Maybe AggregationResults
1790
1790
1791
1791
1792−data Bucket a = Bucket { buckets :: [a]} deriving (Show)
1792+data Bucket a = Bucket { buckets :: [a]} deriving (Read, Show)
1793
1793
1794data BucketValue = TextValue Text
1794data BucketValue = TextValue Text
1795 | ScientificValue Scientific
1795 | ScientificValue Scientific
1796− | BoolValue Bool deriving (Show)
1796+ | BoolValue Bool deriving (Read, Show)
1797
1797
1798data MissingResult = MissingResult { missingDocCount :: Int } deriving (Show)
1798data MissingResult = MissingResult { missingDocCount :: Int } deriving (Show)
1799
1799
1800data TermsResult = TermsResult { termKey :: BucketValue
1800data TermsResult = TermsResult { termKey :: BucketValue
1801 , termsDocCount :: Int
1801 , termsDocCount :: Int
1802− , termsAggs :: Maybe AggregationResults } deriving (Show)
1802+ , termsAggs :: Maybe AggregationResults } deriving (Read, Show)
1803
1803
1804data DateHistogramResult = DateHistogramResult { dateKey :: Int
1804data DateHistogramResult = DateHistogramResult { dateKey :: Int
1805 , dateKeyStr :: Maybe Text
1805 , dateKeyStr :: Maybe Text
1806 , dateDocCount :: Int
1806 , dateDocCount :: Int
1807− , dateHistogramAggs :: Maybe AggregationResults } deriving (Show)
1807+ , dateHistogramAggs :: Maybe AggregationResults } deriving (Read, Show)
1808
1808
1809data DateRangeResult = DateRangeResult { dateRangeKey :: Text
1809data DateRangeResult = DateRangeResult { dateRangeKey :: Text
1810 , dateRangeFrom :: Maybe UTCTime
1810 , dateRangeFrom :: Maybe UTCTime
@@ -1812,7 +1812,7 @@ data DateRangeResult = DateRangeResult { dateRangeKey :: Text
1812 , dateRangeTo :: Maybe UTCTime
1812 , dateRangeTo :: Maybe UTCTime
1813 , dateRangeToAsString :: Maybe Text
1813 , dateRangeToAsString :: Maybe Text
1814 , dateRangeDocCount :: Int
1814 , dateRangeDocCount :: Int
1815− , dateRangeAggs :: Maybe AggregationResults } deriving (Show, Eq, Generic, Typeable)
1815+ , dateRangeAggs :: Maybe AggregationResults } deriving (Read, Show, Eq, Generic, Typeable)
1816
1816
1817toTerms :: Text -> AggregationResults -> Maybe (Bucket TermsResult)
1817toTerms :: Text -> AggregationResults -> Maybe (Bucket TermsResult)
1818toTerms = toAggResult
1818toTerms = toAggResult
@@ -3610,7 +3610,7 @@ instance Enum DocVersion where
3610 enumFromThen = boundedEnumFromThen
3610 enumFromThen = boundedEnumFromThen
3611
3611
3612-- | Username type used for HTTP Basic authentication. See 'basicAuthHook'.
3612-- | Username type used for HTTP Basic authentication. See 'basicAuthHook'.
3613−newtype EsUsername = EsUsername { esUsername :: Text } deriving (Show, Eq)
3613+newtype EsUsername = EsUsername { esUsername :: Text } deriving (Read, Show, Eq)
3614
3614
3615-- | Password type used for HTTP Basic authentication. See 'basicAuthHook'.
3615-- | Password type used for HTTP Basic authentication. See 'basicAuthHook'.
3616−newtype EsPassword = EsPassword { esPassword :: Text } deriving (Show, Eq)
3616+newtype EsPassword = EsPassword { esPassword :: Text } deriving (Read, Show, Eq)