git.iko.soy/typeable/bloodhound
on master help sign in
Add Read instances
commitca21210639d430cf20f1931193cf4e163756fb91 authorDmitry Dzhus <dima@dzhus.org> dateTue 12 Jan 2016, 12:21 (11 years ago) parentca7a595
1 file changed+190−190
src/Database/Bloodhound/Types.hs+190−190
src/Database/Bloodhound/Types.hs+190−190
@@ -363,7 +363,7 @@ data Version = Version { number :: Text
363363 , build_hash :: Text
364364 , build_timestamp :: UTCTime
365365 , build_snapshot :: Bool
366− , lucene_version :: Text } deriving (Eq, Show, Generic, Typeable)
366+ , lucene_version :: Text } deriving (Eq, Read, Show, Generic, Typeable)
367367
368368{-| 'Status' is a data type for describing the JSON body returned by
369369 Elasticsearch when you query its status. This was deprecated in 1.2.0.
@@ -375,7 +375,7 @@ data Status = Status { ok :: Maybe Bool
375375 , status :: Int
376376 , name :: Text
377377 , version :: Version
378− , tagline :: Text } deriving (Eq, Show, Generic)
378+ , tagline :: Text } deriving (Eq, Read, Show, Generic)
379379
380380{-| 'IndexSettings' is used to configure the shards and replicas when you create
381381 an Elasticsearch Index.
@@ -385,7 +385,7 @@ data Status = Status { ok :: Maybe Bool
385385
386386data IndexSettings =
387387 IndexSettings { indexShards :: ShardCount
388− , indexReplicas :: ReplicaCount } deriving (Eq, Show, Generic, Typeable)
388+ , indexReplicas :: ReplicaCount } deriving (Eq, Read, Show, Generic, Typeable)
389389
390390{-| 'defaultIndexSettings' is an 'IndexSettings' with 3 shards and 2 replicas. -}
391391defaultIndexSettings :: IndexSettings
@@ -475,35 +475,35 @@ data AllocationPolicy = AllocAll
475475 -- ^ Allows shard allocation only for primary shards for new indices.
476476 | AllocNone
477477 -- ^ No shard allocation is allowed
478− deriving (Eq, Show, Generic, Typeable)
478+ deriving (Eq, Read, Show, Generic, Typeable)
479479
480480data ReplicaBounds = ReplicasBounded Int Int
481481 | ReplicasLowerBounded Int
482482 | ReplicasUnbounded
483− deriving (Eq, Show, Generic, Typeable)
483+ deriving (Eq, Read, Show, Generic, Typeable)
484484
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)
486486
487487data FSType = FSSimple
488− | FSBuffered deriving (Eq, Show, Generic, Typeable, Ord)
488+ | FSBuffered deriving (Eq, Read, Show, Generic, Typeable, Ord)
489489
490490data InitialShardCount = QuorumShards
491491 | QuorumMinus1Shards
492492 | FullShards
493493 | FullMinus1Shards
494494 | ExplicitShards Int
495− deriving (Eq, Show, Generic, Typeable)
495+ deriving (Eq, Read, Show, Generic, Typeable)
496496
497497data NodeAttrFilter = NodeAttrFilter { nodeAttrFilterName :: NodeAttrName
498498 , nodeAttrFilterValues :: NonEmpty Text}
499− deriving (Eq, Show, Generic, Ord)
499+ deriving (Eq, Read, Show, Generic, Ord)
500500
501−newtype NodeAttrName = NodeAttrName Text deriving (Eq, Show, Ord, Generic, Typeable)
501+newtype NodeAttrName = NodeAttrName Text deriving (Eq, Read, Show, Ord, Generic, Typeable)
502502
503503data CompoundFormat = CompoundFileFormat Bool
504504 | MergeSegmentVsTotalIndex Double
505505 -- ^ 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)
507507
508508newtype NominalDiffTimeJSON = NominalDiffTimeJSON { ndtJSON :: NominalDiffTime }
509509
@@ -520,7 +520,7 @@ type Method = NHTM.Method
520520
521521 <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-open-close.html>
522522-}
523−data OpenCloseIndex = OpenIndex | CloseIndex deriving (Eq, Show, Generic, Typeable)
523+data OpenCloseIndex = OpenIndex | CloseIndex deriving (Eq, Read, Show, Generic, Typeable)
524524
525525data FieldType = GeoPointType
526526 | GeoShapeType
@@ -528,10 +528,10 @@ data FieldType = GeoPointType
528528 | IntegerType
529529 | LongType
530530 | ShortType
531− | ByteType deriving (Eq, Show, Generic, Typeable)
531+ | ByteType deriving (Eq, Read, Show, Generic, Typeable)
532532
533533data FieldDefinition =
534− FieldDefinition { fieldType :: FieldType } deriving (Eq, Show, Generic, Typeable)
534+ FieldDefinition { fieldType :: FieldType } deriving (Eq, Read, Show, Generic, Typeable)
535535
536536{-| An 'IndexTemplate' defines a template that will automatically be
537537 applied to new indices created. The templates include both
@@ -549,7 +549,7 @@ data IndexTemplate =
549549
550550data MappingField =
551551 MappingField { mappingFieldName :: FieldName
552− , fieldDefinition :: FieldDefinition } deriving (Eq, Show, Generic, Typeable)
552+ , fieldDefinition :: FieldDefinition } deriving (Eq, Read, Show, Generic, Typeable)
553553
554554{-| Support for type reification of 'Mapping's is currently incomplete, for
555555 now the mapping API verbiage expects a 'ToJSON'able blob.
@@ -559,7 +559,7 @@ data MappingField =
559559 and keeping different kinds of documents separated if possible.
560560-}
561561data Mapping = Mapping { typeName :: TypeName
562− , mappingFields :: [MappingField] } deriving (Eq, Show, Generic, Typeable)
562+ , mappingFields :: [MappingField] } deriving (Eq, Read, Show, Generic, Typeable)
563563
564564{-| 'BulkOperation' is a sum type for expressing the four kinds of bulk
565565 operation index, create, delete, and update. 'BulkIndex' behaves like an
@@ -571,7 +571,7 @@ data BulkOperation =
571571 BulkIndex IndexName MappingName DocId Value
572572 | BulkCreate IndexName MappingName DocId Value
573573 | 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)
575575
576576{-| 'EsResult' describes the standard wrapper JSON document that you see in
577577 successful Elasticsearch lookups or lookups that couldn't find the document.
@@ -579,20 +579,20 @@ data BulkOperation =
579579data EsResult a = EsResult { _index :: Text
580580 , _type :: Text
581581 , _id :: Text
582− , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Show, Generic, Typeable)
582+ , foundResult :: Maybe (EsResultFound a)} deriving (Eq, Read, Show, Generic, Typeable)
583583
584584{-| 'EsResultFound' contains the document and its metadata inside of an
585585 'EsResult' when the document was successfully found.
586586-}
587587data EsResultFound a = EsResultFound { _version :: DocVersion
588− , _source :: a } deriving (Eq, Show, Generic, Typeable)
588+ , _source :: a } deriving (Eq, Read, Show, Generic, Typeable)
589589
590590{-| 'EsError' is the generic type that will be returned when there was a
591591 problem. If you can't parse the expected response, its a good idea to
592592 try parsing this.
593593-}
594594data EsError = EsError { errorStatus :: Int
595− , errorMessage :: Text } deriving (Eq, Show, Generic, Typeable)
595+ , errorMessage :: Text } deriving (Eq, Read, Show, Generic, Typeable)
596596
597597{-| 'EsProtocolException' will be thrown if Bloodhound cannot parse a response
598598returned by the ElasticSearch server. If you encounter this error, please
@@ -603,44 +603,44 @@ incompatibility between Bloodhound and ElasticSearch. Please open a bug report
603603and be sure to include the exception body.
604604-}
605605data EsProtocolException = EsProtocolException { esProtoExBody :: L.ByteString }
606− deriving (Eq, Show, Generic, Typeable)
606+ deriving (Eq, Read, Show, Generic, Typeable)
607607
608608instance Exception EsProtocolException
609609
610610data IndexAlias = IndexAlias { srcIndex :: IndexName
611− , indexAlias :: IndexAliasName } deriving (Eq, Show, Generic, Typeable)
611+ , indexAlias :: IndexAliasName } deriving (Eq, Read, Show, Generic, Typeable)
612612
613−newtype IndexAliasName = IndexAliasName { indexAliasName :: IndexName } deriving (Eq, Show, Generic, ToJSON)
613+newtype IndexAliasName = IndexAliasName { indexAliasName :: IndexName } deriving (Eq, Read, Show, Generic, ToJSON)
614614
615615data IndexAliasAction = AddAlias IndexAlias IndexAliasCreate
616− | RemoveAlias IndexAlias deriving (Show, Eq, Generic, Typeable)
616+ | RemoveAlias IndexAlias deriving (Read, Show, Eq, Generic, Typeable)
617617
618618data IndexAliasCreate = IndexAliasCreate { aliasCreateRouting :: Maybe AliasRouting
619619 , aliasCreateFilter :: Maybe Filter}
620− deriving (Show, Eq, Generic, Typeable)
620+ deriving (Read, Show, Eq, Generic, Typeable)
621621
622622data AliasRouting = AllAliasRouting RoutingValue
623623 | GranularAliasRouting (Maybe SearchAliasRouting) (Maybe IndexAliasRouting)
624− deriving (Show, Eq, Generic, Typeable)
624+ deriving (Read, Show, Eq, Generic, Typeable)
625625
626−newtype SearchAliasRouting = SearchAliasRouting (NonEmpty RoutingValue) deriving (Show, Eq, Generic, Typeable)
626+newtype SearchAliasRouting = SearchAliasRouting (NonEmpty RoutingValue) deriving (Read, Show, Eq, Generic, Typeable)
627627
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)
629629
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)
631631
632−newtype IndexAliasesSummary = IndexAliasesSummary { indexAliasesSummary :: [IndexAliasSummary] } deriving (Show, Eq, Generic, Typeable)
632+newtype IndexAliasesSummary = IndexAliasesSummary { indexAliasesSummary :: [IndexAliasSummary] } deriving (Read, Show, Eq, Generic, Typeable)
633633
634634{-| 'IndexAliasSummary' is a summary of an index alias configured for a server. -}
635635data IndexAliasSummary = IndexAliasSummary { indexAliasSummaryAlias :: IndexAlias
636− , indexAliasSummaryCreate :: IndexAliasCreate} deriving (Show, Eq, Generic, Typeable)
636+ , indexAliasSummaryCreate :: IndexAliasCreate} deriving (Read, Show, Eq, Generic, Typeable)
637637
638638{-| 'DocVersion' is an integer version number for a document between 1
639639and 9.2e+18 used for <<https://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html optimistic concurrency control>>.
640640-}
641641newtype DocVersion = DocVersion {
642642 docVersionNumber :: Int
643− } deriving (Eq, Show, Generic, Ord, ToJSON)
643+ } deriving (Eq, Read, Show, Generic, Ord, ToJSON)
644644
645645-- | Smart constructor for in-range doc version
646646mkDocVersion :: Int -> Maybe DocVersion
@@ -654,7 +654,7 @@ mkDocVersion i
654654own version numbers instead of ones from ES.
655655-}
656656newtype ExternalDocVersion = ExternalDocVersion DocVersion
657− deriving (Eq, Show, Generic, Ord, Bounded, Enum, ToJSON)
657+ deriving (Eq, Read, Show, Generic, Ord, Bounded, Enum, ToJSON)
658658
659659{-| 'VersionControl' is specified when indexing documents as a
660660optimistic concurrency control.
@@ -688,12 +688,12 @@ data VersionControl = NoVersionControl
688688 -- given version will be the new version. This is
689689 -- typically used for correcting errors. Use with
690690 -- care, as this could result in data loss.
691− deriving (Show, Eq, Generic, Ord)
691+ deriving (Read, Show, Eq, Generic, Ord)
692692
693693{-| 'DocumentParent' is used to specify a parent document.
694694-}
695695newtype DocumentParent = DocumentParent DocId
696− deriving (Eq, Show, Generic, Typeable)
696+ deriving (Eq, Read, Show, Generic, Typeable)
697697
698698{-| 'IndexDocumentSettings' are special settings supplied when indexing
699699a document. For the best backwards compatiblity when new fields are
@@ -702,7 +702,7 @@ added, you should probably prefer to start with 'defaultIndexDocumentSettings'
702702data IndexDocumentSettings =
703703 IndexDocumentSettings { idsVersionControl :: VersionControl
704704 , idsParent :: Maybe DocumentParent
705− } deriving (Eq, Show, Generic, Typeable)
705+ } deriving (Eq, Read, Show, Generic, Typeable)
706706
707707{-| Reasonable default settings. Chooses no version control and no parent.
708708-}
@@ -722,7 +722,7 @@ type Sort = [SortSpec]
722722<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
723723-}
724724data SortSpec = DefaultSortSpec DefaultSort
725− | GeoDistanceSortSpec SortOrder GeoPoint DistanceUnit deriving (Eq, Show, Generic, Typeable)
725+ | GeoDistanceSortSpec SortOrder GeoPoint DistanceUnit deriving (Eq, Read, Show, Generic, Typeable)
726726
727727{-| 'DefaultSort' is usually the kind of 'SortSpec' you'll want. There's a
728728 'mkSort' convenience function for when you want to specify only the most
@@ -737,7 +737,7 @@ data DefaultSort =
737737 , ignoreUnmapped :: Bool
738738 , sortMode :: Maybe SortMode
739739 , missingSort :: Maybe Missing
740− , nestedFilter :: Maybe Filter } deriving (Eq, Show, Generic, Typeable)
740+ , nestedFilter :: Maybe Filter } deriving (Eq, Read, Show, Generic, Typeable)
741741
742742{-| 'SortOrder' is 'Ascending' or 'Descending', as you might expect. These get
743743 encoded into "asc" or "desc" when turned into JSON.
@@ -745,7 +745,7 @@ data DefaultSort =
745745<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort>
746746-}
747747data SortOrder = Ascending
748− | Descending deriving (Eq, Show, Generic, Typeable)
748+ | Descending deriving (Eq, Read, Show, Generic, Typeable)
749749
750750{-| 'Missing' prescribes how to handle missing fields. A missing field can be
751751 sorted last, first, or using a custom value as a substitute.
@@ -754,7 +754,7 @@ data SortOrder = Ascending
754754-}
755755data Missing = LastMissing
756756 | FirstMissing
757− | CustomMissing Text deriving (Eq, Show, Generic, Typeable)
757+ | CustomMissing Text deriving (Eq, Read, Show, Generic, Typeable)
758758
759759{-| 'SortMode' prescribes how to handle sorting array/multi-valued fields.
760760
@@ -763,7 +763,7 @@ http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-req
763763data SortMode = SortMin
764764 | SortMax
765765 | SortSum
766− | SortAvg deriving (Eq, Show, Generic, Typeable)
766+ | SortAvg deriving (Eq, Read, Show, Generic, Typeable)
767767
768768{-| 'mkSort' defaults everything but the 'FieldName' and the 'SortOrder' so
769769 that you can concisely describe the usual kind of 'SortSpec's you want.
@@ -785,19 +785,19 @@ type PrefixValue = Text
785785{-| 'BooleanOperator' is the usual And/Or operators with an ES compatible
786786 JSON encoding baked in. Used all over the place.
787787-}
788−data BooleanOperator = And | Or deriving (Eq, Show, Generic, Typeable)
788+data BooleanOperator = And | Or deriving (Eq, Read, Show, Generic, Typeable)
789789
790790{-| 'ShardCount' is part of 'IndexSettings'
791791-}
792−newtype ShardCount = ShardCount Int deriving (Eq, Show, Generic, ToJSON, Typeable)
792+newtype ShardCount = ShardCount Int deriving (Eq, Read, Show, Generic, ToJSON, Typeable)
793793
794794{-| 'ReplicaCount' is part of 'IndexSettings'
795795-}
796−newtype ReplicaCount = ReplicaCount Int deriving (Eq, Show, Generic, ToJSON, Typeable)
796+newtype ReplicaCount = ReplicaCount Int deriving (Eq, Read, Show, Generic, ToJSON, Typeable)
797797
798798{-| 'IndexName' is used to describe which index to query/create/delete
799799-}
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)
801801
802802{-| 'IndexSelection' is used for APIs which take a single index, a list of
803803 indexes, or the special @_all@ index.
@@ -807,133 +807,133 @@ data IndexSelection = IndexList (NonEmpty IndexName)
807807
808808{-| 'TemplateName' is used to describe which template to query/create/delete
809809-}
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)
811811
812812{-| 'TemplatePattern' represents a pattern which is matched against index names
813813-}
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)
815815
816816{-| 'MappingName' is part of mappings which are how ES describes and schematizes
817817 the data in the indices.
818818-}
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)
820820
821821{-| 'DocId' is a generic wrapper value for expressing unique Document IDs.
822822 Can be set by the user or created by ES itself. Often used in client
823823 functions for poking at specific documents.
824824-}
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)
826826
827827{-| 'QueryString' is used to wrap query text bodies, be they human written or not.
828828-}
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)
830830
831831{-| 'FieldName' is used all over the place wherever a specific field within
832832 a document needs to be specified, usually in 'Query's or 'Filter's.
833833-}
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)
835835
836836
837837{-| 'Script' is often used in place of 'FieldName' to specify more
838838complex ways of extracting a value from a document.
839839-}
840−newtype Script = Script { scriptText :: Text } deriving (Eq, Show, Generic, Typeable)
840+newtype Script = Script { scriptText :: Text } deriving (Eq, Read, Show, Generic, Typeable)
841841
842842{-| 'CacheName' is used in 'RegexpFilter' for describing the
843843 'CacheKey' keyed caching behavior.
844844-}
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)
846846
847847{-| 'CacheKey' is used in 'RegexpFilter' to key regex caching.
848848-}
849849newtype CacheKey =
850− CacheKey Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
850+ CacheKey Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
851851newtype Existence =
852− Existence Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
852+ Existence Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
853853newtype NullValue =
854− NullValue Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
854+ NullValue Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
855855newtype CutoffFrequency =
856− CutoffFrequency Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
856+ CutoffFrequency Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
857857newtype Analyzer =
858− Analyzer Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
858+ Analyzer Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
859859newtype MaxExpansions =
860− MaxExpansions Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
860+ MaxExpansions Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
861861
862862{-| 'Lenient', if set to true, will cause format based failures to be
863863 ignored. I don't know what the bloody default is, Elasticsearch
864864 documentation didn't say what it was. Let me know if you figure it out.
865865-}
866866newtype Lenient =
867− Lenient Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
867+ Lenient Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
868868newtype Tiebreaker =
869− Tiebreaker Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
869+ Tiebreaker Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
870870newtype Boost =
871− Boost Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
871+ Boost Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
872872newtype BoostTerms =
873− BoostTerms Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
873+ BoostTerms Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
874874
875875{-| 'MinimumMatch' controls how many should clauses in the bool query should
876876 match. Can be an absolute value (2) or a percentage (30%) or a
877877 combination of both.
878878-}
879879newtype MinimumMatch =
880− MinimumMatch Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
880+ MinimumMatch Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
881881newtype DisableCoord =
882− DisableCoord Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
882+ DisableCoord Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
883883newtype IgnoreTermFrequency =
884− IgnoreTermFrequency Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
884+ IgnoreTermFrequency Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
885885newtype MinimumTermFrequency =
886− MinimumTermFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
886+ MinimumTermFrequency Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
887887newtype MaxQueryTerms =
888− MaxQueryTerms Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
888+ MaxQueryTerms Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
889889newtype Fuzziness =
890− Fuzziness Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
890+ Fuzziness Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
891891
892892{-| 'PrefixLength' is the prefix length used in queries, defaults to 0. -}
893893newtype PrefixLength =
894− PrefixLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
894+ PrefixLength Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
895895newtype TypeName =
896− TypeName Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
896+ TypeName Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
897897newtype PercentMatch =
898− PercentMatch Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
898+ PercentMatch Double deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
899899newtype StopWord =
900− StopWord Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
900+ StopWord Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
901901newtype QueryPath =
902− QueryPath Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
902+ QueryPath Text deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
903903
904904{-| Allowing a wildcard at the beginning of a word (eg "*ing") is particularly
905905 heavy, because all terms in the index need to be examined, just in case
906906 they match. Leading wildcards can be disabled by setting
907907 'AllowLeadingWildcard' to false. -}
908908newtype AllowLeadingWildcard =
909− AllowLeadingWildcard Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
909+ AllowLeadingWildcard Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
910910newtype LowercaseExpanded =
911− LowercaseExpanded Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
911+ LowercaseExpanded Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
912912newtype EnablePositionIncrements =
913− EnablePositionIncrements Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
913+ EnablePositionIncrements Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
914914
915915{-| By default, wildcard terms in a query are not analyzed.
916916 Setting 'AnalyzeWildcard' to true enables best-effort analysis.
917917-}
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)
919919
920920{-| 'GeneratePhraseQueries' defaults to false.
921921-}
922922newtype GeneratePhraseQueries =
923− GeneratePhraseQueries Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
923+ GeneratePhraseQueries Bool deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
924924
925925{-| 'Locale' is used for string conversions - defaults to ROOT.
926926-}
927−newtype Locale = Locale Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
928−newtype MaxWordLength = MaxWordLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
929−newtype MinWordLength = MinWordLength Int 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, Read, Show, Generic, ToJSON, FromJSON, Typeable)
929+newtype MinWordLength = MinWordLength Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
930930
931931{-| 'PhraseSlop' sets the default slop for phrases, 0 means exact
932932 phrase matches. Default is 0.
933933-}
934−newtype PhraseSlop = PhraseSlop Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
935−newtype MinDocFrequency = MinDocFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
936−newtype MaxDocFrequency = MaxDocFrequency 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, Read, Show, Generic, ToJSON, FromJSON, Typeable)
936+newtype MaxDocFrequency = MaxDocFrequency Int deriving (Eq, Read, Show, Generic, ToJSON, FromJSON, Typeable)
937937
938938-- | Newtype wrapper to parse ES's concerning tendency to in some APIs return a floating point number of milliseconds since epoch ಠ_ಠ
939939newtype POSIXMS = POSIXMS { posixMS :: UTCTime }
@@ -944,8 +944,8 @@ unpackId :: DocId -> Text
944944unpackId (DocId docId) = docId
945945
946946type TrackSortScores = Bool
947−newtype From = From Int deriving (Eq, Show, Generic, ToJSON)
948−newtype Size = Size Int deriving (Eq, Show, Generic, ToJSON)
947+newtype From = From Int deriving (Eq, Read, Show, Generic, ToJSON)
948+newtype Size = Size Int deriving (Eq, Read, Show, Generic, ToJSON)
949949
950950data Search = Search { queryBody :: Maybe Query
951951 , filterBody :: Maybe Filter
@@ -958,7 +958,7 @@ data Search = Search { queryBody :: Maybe Query
958958 , size :: Size
959959 , searchType :: SearchType
960960 , fields :: Maybe [FieldName]
961− , source :: Maybe Source } deriving (Eq, Show, Generic, Typeable)
961+ , source :: Maybe Source } deriving (Eq, Read, Show, Generic, Typeable)
962962
963963data SearchType = SearchTypeQueryThenFetch
964964 | SearchTypeDfsQueryThenFetch
@@ -966,40 +966,40 @@ data SearchType = SearchTypeQueryThenFetch
966966 | SearchTypeScan
967967 | SearchTypeQueryAndFetch
968968 | SearchTypeDfsQueryAndFetch
969− deriving (Eq, Show, Generic, Typeable)
969+ deriving (Eq, Read, Show, Generic, Typeable)
970970
971971data Source =
972972 NoSource
973973 | SourcePatterns PatternOrPatterns
974974 | SourceIncludeExclude Include Exclude
975− deriving (Show, Eq, Generic, Typeable)
975+ deriving (Read, Show, Eq, Generic, Typeable)
976976
977977data PatternOrPatterns = PopPattern Pattern
978− | PopPatterns [Pattern] deriving (Eq, Show, Generic, Typeable)
978+ | PopPatterns [Pattern] deriving (Eq, Read, Show, Generic, Typeable)
979979
980−data Include = Include [Pattern] deriving (Eq, Show, Generic, Typeable)
981−data Exclude = Exclude [Pattern] deriving (Eq, Show, Generic, Typeable)
980+data Include = Include [Pattern] deriving (Eq, Read, Show, Generic, Typeable)
981+data Exclude = Exclude [Pattern] deriving (Eq, Read, Show, Generic, Typeable)
982982
983−newtype Pattern = Pattern Text deriving (Eq, Show, Generic, Typeable)
983+newtype Pattern = Pattern Text deriving (Eq, Read, Show, Generic, Typeable)
984984
985985data Highlights = Highlights { globalsettings :: Maybe HighlightSettings
986986 , highlightFields :: [FieldHighlight]
987− } deriving (Show, Eq, Generic, Typeable)
987+ } deriving (Read, Show, Eq, Generic, Typeable)
988988
989989data FieldHighlight = FieldHighlight FieldName (Maybe HighlightSettings)
990− deriving (Show, Eq, Generic, Typeable)
990+ deriving (Read, Show, Eq, Generic, Typeable)
991991
992992
993993data HighlightSettings = Plain PlainHighlight
994994 | Postings PostingsHighlight
995995 | FastVector FastVectorHighlight
996− deriving (Show, Eq, Generic, Typeable)
996+ deriving (Read, Show, Eq, Generic, Typeable)
997997data PlainHighlight =
998998 PlainHighlight { plainCommon :: Maybe CommonHighlight
999− , plainNonPost :: Maybe NonPostings } deriving (Show, Eq, Generic, Typeable)
999+ , plainNonPost :: Maybe NonPostings } deriving (Read, Show, Eq, Generic, Typeable)
10001000
10011001 -- 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)
10031003
10041004-- This requires that term_vector is set to 'with_positions_offsets' in the mapping.
10051005data FastVectorHighlight =
@@ -1010,7 +1010,7 @@ data FastVectorHighlight =
10101010 , fragmentOffset :: Maybe Int
10111011 , matchedFields :: [Text]
10121012 , phraseLimit :: Maybe Int
1013− } deriving (Show, Eq, Generic, Typeable)
1013+ } deriving (Read, Show, Eq, Generic, Typeable)
10141014
10151015data CommonHighlight =
10161016 CommonHighlight { order :: Maybe Text
@@ -1020,21 +1020,21 @@ data CommonHighlight =
10201020 , noMatchSize :: Maybe Int
10211021 , highlightQuery :: Maybe Query
10221022 , requireFieldMatch :: Maybe Bool
1023− } deriving (Show, Eq, Generic, Typeable)
1023+ } deriving (Read, Show, Eq, Generic, Typeable)
10241024
10251025-- Settings that are only applicable to FastVector and Plain highlighters.
10261026data NonPostings =
10271027 NonPostings { fragmentSize :: Maybe Int
1028− , numberOfFragments :: Maybe Int} deriving (Show, Eq, Generic, Typeable)
1028+ , numberOfFragments :: Maybe Int} deriving (Read, Show, Eq, Generic, Typeable)
10291029
10301030data HighlightEncoder = DefaultEncoder
10311031 | HTMLEncoder
1032− deriving (Show, Eq, Generic, Typeable)
1032+ deriving (Read, Show, Eq, Generic, Typeable)
10331033
10341034-- NOTE: Should the tags use some kind of HTML type, rather than Text?
10351035data HighlightTag = TagSchema Text
10361036 | 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)
10381038
10391039
10401040data Query =
@@ -1065,19 +1065,19 @@ data Query =
10651065 | QuerySimpleQueryStringQuery SimpleQueryStringQuery
10661066 | QueryRangeQuery RangeQuery
10671067 | QueryRegexpQuery RegexpQuery
1068− deriving (Eq, Show, Generic, Typeable)
1068+ deriving (Eq, Read, Show, Generic, Typeable)
10691069
10701070data RegexpQuery =
10711071 RegexpQuery { regexpQueryField :: FieldName
10721072 , regexpQuery :: Regexp
10731073 , regexpQueryFlags :: RegexpFlags
10741074 , regexpQueryBoost :: Maybe Boost
1075− } deriving (Eq, Show, Generic, Typeable)
1075+ } deriving (Eq, Read, Show, Generic, Typeable)
10761076
10771077data RangeQuery =
10781078 RangeQuery { rangeQueryField :: FieldName
10791079 , rangeQueryRange :: RangeValue
1080− , rangeQueryBoost :: Boost } deriving (Eq, Show, Generic, Typeable)
1080+ , rangeQueryBoost :: Boost } deriving (Eq, Read, Show, Generic, Typeable)
10811081
10821082mkRangeQuery :: FieldName -> RangeValue -> RangeQuery
10831083mkRangeQuery f r = RangeQuery f r (Boost 1.0)
@@ -1091,7 +1091,7 @@ data SimpleQueryStringQuery =
10911091 , simpleQueryStringFlags :: Maybe (NonEmpty SimpleQueryFlag)
10921092 , simpleQueryStringLowercaseExpanded :: Maybe LowercaseExpanded
10931093 , simpleQueryStringLocale :: Maybe Locale
1094− } deriving (Eq, Show, Generic, Typeable)
1094+ } deriving (Eq, Read, Show, Generic, Typeable)
10951095
10961096data SimpleQueryFlag =
10971097 SimpleQueryAll
@@ -1105,7 +1105,7 @@ data SimpleQueryFlag =
11051105 | SimpleQueryWhitespace
11061106 | SimpleQueryFuzzy
11071107 | SimpleQueryNear
1108− | SimpleQuerySlop deriving (Eq, Show, Generic, Typeable)
1108+ | SimpleQuerySlop deriving (Eq, Read, Show, Generic, Typeable)
11091109
11101110-- use_dis_max and tie_breaker when fields are plural?
11111111data QueryStringQuery =
@@ -1127,7 +1127,7 @@ data QueryStringQuery =
11271127 , queryStringMinimumShouldMatch :: Maybe MinimumMatch
11281128 , queryStringLenient :: Maybe Lenient
11291129 , queryStringLocale :: Maybe Locale
1130− } deriving (Eq, Show, Generic, Typeable)
1130+ } deriving (Eq, Read, Show, Generic, Typeable)
11311131
11321132mkQueryStringQuery :: QueryString -> QueryStringQuery
11331133mkQueryStringQuery qs =
@@ -1138,19 +1138,19 @@ mkQueryStringQuery qs =
11381138 Nothing Nothing
11391139
11401140data FieldOrFields = FofField FieldName
1141− | FofFields (NonEmpty FieldName) deriving (Eq, Show, Generic, Typeable)
1141+ | FofFields (NonEmpty FieldName) deriving (Eq, Read, Show, Generic, Typeable)
11421142
11431143data PrefixQuery =
11441144 PrefixQuery
11451145 { prefixQueryField :: FieldName
11461146 , prefixQueryPrefixValue :: Text
1147− , prefixQueryBoost :: Maybe Boost } deriving (Eq, Show, Generic, Typeable)
1147+ , prefixQueryBoost :: Maybe Boost } deriving (Eq, Read, Show, Generic, Typeable)
11481148
11491149data NestedQuery =
11501150 NestedQuery
11511151 { nestedQueryPath :: QueryPath
11521152 , nestedQueryScoreType :: ScoreType
1153− , nestedQuery :: Query } deriving (Eq, Show, Generic, Typeable)
1153+ , nestedQuery :: Query } deriving (Eq, Read, Show, Generic, Typeable)
11541154
11551155data MoreLikeThisFieldQuery =
11561156 MoreLikeThisFieldQuery
@@ -1168,7 +1168,7 @@ data MoreLikeThisFieldQuery =
11681168 , moreLikeThisFieldBoostTerms :: Maybe BoostTerms
11691169 , moreLikeThisFieldBoost :: Maybe Boost
11701170 , moreLikeThisFieldAnalyzer :: Maybe Analyzer
1171− } deriving (Eq, Show, Generic, Typeable)
1171+ } deriving (Eq, Read, Show, Generic, Typeable)
11721172
11731173data MoreLikeThisQuery =
11741174 MoreLikeThisQuery
@@ -1186,32 +1186,32 @@ data MoreLikeThisQuery =
11861186 , moreLikeThisBoostTerms :: Maybe BoostTerms
11871187 , moreLikeThisBoost :: Maybe Boost
11881188 , moreLikeThisAnalyzer :: Maybe Analyzer
1189− } deriving (Eq, Show, Generic, Typeable)
1189+ } deriving (Eq, Read, Show, Generic, Typeable)
11901190
11911191data IndicesQuery =
11921192 IndicesQuery
11931193 { indicesQueryIndices :: [IndexName]
11941194 , indicesQuery :: Query
11951195 -- default "all"
1196− , indicesQueryNoMatch :: Maybe Query } deriving (Eq, Show, Generic, Typeable)
1196+ , indicesQueryNoMatch :: Maybe Query } deriving (Eq, Read, Show, Generic, Typeable)
11971197
11981198data HasParentQuery =
11991199 HasParentQuery
12001200 { hasParentQueryType :: TypeName
12011201 , hasParentQuery :: Query
1202− , hasParentQueryScoreType :: Maybe ScoreType } deriving (Eq, Show, Generic, Typeable)
1202+ , hasParentQueryScoreType :: Maybe ScoreType } deriving (Eq, Read, Show, Generic, Typeable)
12031203
12041204data HasChildQuery =
12051205 HasChildQuery
12061206 { hasChildQueryType :: TypeName
12071207 , hasChildQuery :: Query
1208− , hasChildQueryScoreType :: Maybe ScoreType } deriving (Eq, Show, Generic, Typeable)
1208+ , hasChildQueryScoreType :: Maybe ScoreType } deriving (Eq, Read, Show, Generic, Typeable)
12091209
12101210data ScoreType =
12111211 ScoreTypeMax
12121212 | ScoreTypeSum
12131213 | ScoreTypeAvg
1214− | ScoreTypeNone deriving (Eq, Show, Generic, Typeable)
1214+ | ScoreTypeNone deriving (Eq, Read, Show, Generic, Typeable)
12151215
12161216data FuzzyQuery =
12171217 FuzzyQuery { fuzzyQueryField :: FieldName
@@ -1220,7 +1220,7 @@ data FuzzyQuery =
12201220 , fuzzyQueryMaxExpansions :: MaxExpansions
12211221 , fuzzyQueryFuzziness :: Fuzziness
12221222 , fuzzyQueryBoost :: Maybe Boost
1223− } deriving (Eq, Show, Generic, Typeable)
1223+ } deriving (Eq, Read, Show, Generic, Typeable)
12241224
12251225data FuzzyLikeFieldQuery =
12261226 FuzzyLikeFieldQuery
@@ -1233,7 +1233,7 @@ data FuzzyLikeFieldQuery =
12331233 , fuzzyLikeFieldPrefixLength :: PrefixLength
12341234 , fuzzyLikeFieldBoost :: Boost
12351235 , fuzzyLikeFieldAnalyzer :: Maybe Analyzer
1236− } deriving (Eq, Show, Generic, Typeable)
1236+ } deriving (Eq, Read, Show, Generic, Typeable)
12371237
12381238data FuzzyLikeThisQuery =
12391239 FuzzyLikeThisQuery
@@ -1245,19 +1245,19 @@ data FuzzyLikeThisQuery =
12451245 , fuzzyLikePrefixLength :: PrefixLength
12461246 , fuzzyLikeBoost :: Boost
12471247 , fuzzyLikeAnalyzer :: Maybe Analyzer
1248− } deriving (Eq, Show, Generic, Typeable)
1248+ } deriving (Eq, Read, Show, Generic, Typeable)
12491249
12501250data FilteredQuery =
12511251 FilteredQuery
12521252 { filteredQuery :: Query
1253− , filteredFilter :: Filter } deriving (Eq, Show, Generic, Typeable)
1253+ , filteredFilter :: Filter } deriving (Eq, Read, Show, Generic, Typeable)
12541254
12551255data DisMaxQuery =
12561256 DisMaxQuery { disMaxQueries :: [Query]
12571257 -- default 0.0
12581258 , disMaxTiebreaker :: Tiebreaker
12591259 , disMaxBoost :: Maybe Boost
1260− } deriving (Eq, Show, Generic, Typeable)
1260+ } deriving (Eq, Read, Show, Generic, Typeable)
12611261
12621262data MatchQuery =
12631263 MatchQuery { matchQueryField :: FieldName
@@ -1269,7 +1269,7 @@ data MatchQuery =
12691269 , matchQueryAnalyzer :: Maybe Analyzer
12701270 , matchQueryMaxExpansions :: Maybe MaxExpansions
12711271 , matchQueryLenient :: Maybe Lenient
1272− , matchQueryBoost :: Maybe Boost } deriving (Eq, Show, Generic, Typeable)
1272+ , matchQueryBoost :: Maybe Boost } deriving (Eq, Read, Show, Generic, Typeable)
12731273
12741274{-| 'mkMatchQuery' is a convenience function that defaults the less common parameters,
12751275 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
12791279
12801280data MatchQueryType =
12811281 MatchPhrase
1282− | MatchPhrasePrefix deriving (Eq, Show, Generic, Typeable)
1282+ | MatchPhrasePrefix deriving (Eq, Read, Show, Generic, Typeable)
12831283
12841284data MultiMatchQuery =
12851285 MultiMatchQuery { multiMatchQueryFields :: [FieldName]
@@ -1291,7 +1291,7 @@ data MultiMatchQuery =
12911291 , multiMatchQueryCutoffFrequency :: Maybe CutoffFrequency
12921292 , multiMatchQueryAnalyzer :: Maybe Analyzer
12931293 , multiMatchQueryMaxExpansions :: Maybe MaxExpansions
1294− , multiMatchQueryLenient :: Maybe Lenient } deriving (Eq, Show, Generic, Typeable)
1294+ , multiMatchQueryLenient :: Maybe Lenient } deriving (Eq, Read, Show, Generic, Typeable)
12951295
12961296{-| 'mkMultiMatchQuery' is a convenience function that defaults the less common parameters,
12971297 enabling you to provide only the list of 'FieldName's and 'QueryString' to
@@ -1308,7 +1308,7 @@ data MultiMatchQueryType =
13081308 | MultiMatchMostFields
13091309 | MultiMatchCrossFields
13101310 | MultiMatchPhrase
1311− | MultiMatchPhrasePrefix deriving (Eq, Show, Generic, Typeable)
1311+ | MultiMatchPhrasePrefix deriving (Eq, Read, Show, Generic, Typeable)
13121312
13131313data BoolQuery =
13141314 BoolQuery { boolQueryMustMatch :: [Query]
@@ -1317,7 +1317,7 @@ data BoolQuery =
13171317 , boolQueryMinimumShouldMatch :: Maybe MinimumMatch
13181318 , boolQueryBoost :: Maybe Boost
13191319 , boolQueryDisableCoord :: Maybe DisableCoord
1320− } deriving (Eq, Show, Generic, Typeable)
1320+ } deriving (Eq, Read, Show, Generic, Typeable)
13211321
13221322mkBoolQuery :: [Query] -> [Query] -> [Query] -> BoolQuery
13231323mkBoolQuery must mustNot should =
@@ -1326,7 +1326,7 @@ mkBoolQuery must mustNot should =
13261326data BoostingQuery =
13271327 BoostingQuery { positiveQuery :: Query
13281328 , negativeQuery :: Query
1329− , negativeBoost :: Boost } deriving (Eq, Show, Generic, Typeable)
1329+ , negativeBoost :: Boost } deriving (Eq, Read, Show, Generic, Typeable)
13301330
13311331data CommonTermsQuery =
13321332 CommonTermsQuery { commonField :: FieldName
@@ -1338,16 +1338,16 @@ data CommonTermsQuery =
13381338 , commonBoost :: Maybe Boost
13391339 , commonAnalyzer :: Maybe Analyzer
13401340 , commonDisableCoord :: Maybe DisableCoord
1341− } deriving (Eq, Show, Generic, Typeable)
1341+ } deriving (Eq, Read, Show, Generic, Typeable)
13421342
13431343data CommonMinimumMatch =
13441344 CommonMinimumMatchHighLow MinimumMatchHighLow
13451345 | CommonMinimumMatch MinimumMatch
1346− deriving (Eq, Show, Generic, Typeable)
1346+ deriving (Eq, Read, Show, Generic, Typeable)
13471347
13481348data MinimumMatchHighLow =
13491349 MinimumMatchHighLow { lowFreq :: MinimumMatch
1350− , highFreq :: MinimumMatch } deriving (Eq, Show, Generic, Typeable)
1350+ , highFreq :: MinimumMatch } deriving (Eq, Read, Show, Generic, Typeable)
13511351
13521352data Filter = AndFilter [Filter] Cache
13531353 | OrFilter [Filter] Cache
@@ -1367,36 +1367,36 @@ data Filter = AndFilter [Filter] Cache
13671367 | RangeFilter FieldName RangeValue RangeExecution Cache
13681368 | RegexpFilter FieldName Regexp RegexpFlags CacheName Cache CacheKey
13691369 | TermFilter Term Cache
1370− deriving (Eq, Show, Generic, Typeable)
1370+ deriving (Eq, Read, Show, Generic, Typeable)
13711371
13721372data ZeroTermsQuery = ZeroTermsNone
1373− | ZeroTermsAll deriving (Eq, Show, Generic, Typeable)
1373+ | ZeroTermsAll deriving (Eq, Read, Show, Generic, Typeable)
13741374
13751375data RangeExecution = RangeExecutionIndex
1376− | RangeExecutionFielddata deriving (Eq, Show, Generic, Typeable)
1376+ | RangeExecutionFielddata deriving (Eq, Read, Show, Generic, Typeable)
13771377
1378−newtype Regexp = Regexp Text deriving (Eq, Show, Generic, Typeable, FromJSON)
1378+newtype Regexp = Regexp Text deriving (Eq, Read, Show, Generic, Typeable, FromJSON)
13791379
13801380data RegexpFlags = AllRegexpFlags
13811381 | NoRegexpFlags
1382− | SomeRegexpFlags (NonEmpty RegexpFlag) deriving (Eq, Show, Generic, Typeable)
1382+ | SomeRegexpFlags (NonEmpty RegexpFlag) deriving (Eq, Read, Show, Generic, Typeable)
13831383
13841384data RegexpFlag = AnyString
13851385 | Automaton
13861386 | Complement
13871387 | Empty
13881388 | Intersection
1389− | Interval deriving (Eq, Show, Generic, Typeable)
1389+ | Interval deriving (Eq, Read, Show, Generic, Typeable)
13901390
1391−newtype LessThan = LessThan Double deriving (Eq, Show, Generic, Typeable)
1392−newtype LessThanEq = LessThanEq Double deriving (Eq, Show, Generic, Typeable)
1393−newtype GreaterThan = GreaterThan Double deriving (Eq, Show, Generic, Typeable)
1394−newtype GreaterThanEq = GreaterThanEq Double deriving (Eq, Show, Generic, Typeable)
1391+newtype LessThan = LessThan Double deriving (Eq, Read, Show, Generic, Typeable)
1392+newtype LessThanEq = LessThanEq Double deriving (Eq, Read, Show, Generic, Typeable)
1393+newtype GreaterThan = GreaterThan Double deriving (Eq, Read, Show, Generic, Typeable)
1394+newtype GreaterThanEq = GreaterThanEq Double deriving (Eq, Read, Show, Generic, Typeable)
13951395
1396−newtype LessThanD = LessThanD UTCTime deriving (Eq, Show, Generic, Typeable)
1397−newtype LessThanEqD = LessThanEqD UTCTime deriving (Eq, Show, Generic, Typeable)
1398−newtype GreaterThanD = GreaterThanD UTCTime deriving (Eq, Show, Generic, Typeable)
1399−newtype GreaterThanEqD = GreaterThanEqD UTCTime deriving (Eq, Show, Generic, Typeable)
1396+newtype LessThanD = LessThanD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
1397+newtype LessThanEqD = LessThanEqD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
1398+newtype GreaterThanD = GreaterThanD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
1399+newtype GreaterThanEqD = GreaterThanEqD UTCTime deriving (Eq, Read, Show, Generic, Typeable)
14001400
14011401data RangeValue = RangeDateLte LessThanEqD
14021402 | RangeDateLt LessThanD
@@ -1414,7 +1414,7 @@ data RangeValue = RangeDateLte LessThanEqD
14141414 | RangeDoubleGteLte GreaterThanEq LessThanEq
14151415 | RangeDoubleGteLt GreaterThanEq LessThan
14161416 | RangeDoubleGtLte GreaterThan LessThanEq
1417− deriving (Eq, Show, Generic, Typeable)
1417+ deriving (Eq, Read, Show, Generic, Typeable)
14181418
14191419rangeValueToPair :: RangeValue -> [Pair]
14201420rangeValueToPair rv = case rv of
@@ -1436,33 +1436,33 @@ rangeValueToPair rv = case rv of
14361436 RangeDoubleGtLt (GreaterThan l) (LessThan g) -> ["gt" .= l, "lt" .= g]
14371437
14381438data Term = Term { termField :: Text
1439− , termValue :: Text } deriving (Eq, Show, Generic, Typeable)
1439+ , termValue :: Text } deriving (Eq, Read, Show, Generic, Typeable)
14401440
14411441data BoolMatch = MustMatch Term Cache
14421442 | MustNotMatch Term Cache
1443− | ShouldMatch [Term] Cache deriving (Eq, Show, Generic, Typeable)
1443+ | ShouldMatch [Term] Cache deriving (Eq, Read, Show, Generic, Typeable)
14441444
14451445-- "memory" or "indexed"
14461446data GeoFilterType = GeoFilterMemory
1447− | GeoFilterIndexed deriving (Eq, Show, Generic, Typeable)
1447+ | GeoFilterIndexed deriving (Eq, Read, Show, Generic, Typeable)
14481448
14491449data LatLon = LatLon { lat :: Double
1450− , lon :: Double } deriving (Eq, Show, Generic, Typeable)
1450+ , lon :: Double } deriving (Eq, Read, Show, Generic, Typeable)
14511451
14521452data GeoBoundingBox =
14531453 GeoBoundingBox { topLeft :: LatLon
1454− , bottomRight :: LatLon } deriving (Eq, Show, Generic, Typeable)
1454+ , bottomRight :: LatLon } deriving (Eq, Read, Show, Generic, Typeable)
14551455
14561456data GeoBoundingBoxConstraint =
14571457 GeoBoundingBoxConstraint { geoBBField :: FieldName
14581458 , constraintBox :: GeoBoundingBox
14591459 , bbConstraintcache :: Cache
14601460 , geoType :: GeoFilterType
1461− } deriving (Eq, Show, Generic, Typeable)
1461+ } deriving (Eq, Read, Show, Generic, Typeable)
14621462
14631463data GeoPoint =
14641464 GeoPoint { geoField :: FieldName
1465− , latLon :: LatLon} deriving (Eq, Show, Generic, Typeable)
1465+ , latLon :: LatLon} deriving (Eq, Read, Show, Generic, Typeable)
14661466
14671467data DistanceUnit = Miles
14681468 | Yards
@@ -1472,22 +1472,22 @@ data DistanceUnit = Miles
14721472 | Meters
14731473 | Centimeters
14741474 | Millimeters
1475− | NauticalMiles deriving (Eq, Show, Generic, Typeable)
1475+ | NauticalMiles deriving (Eq, Read, Show, Generic, Typeable)
14761476
14771477data DistanceType = Arc
14781478 | SloppyArc -- doesn't exist <1.0
1479− | Plane deriving (Eq, Show, Generic, Typeable)
1479+ | Plane deriving (Eq, Read, Show, Generic, Typeable)
14801480
14811481data OptimizeBbox = OptimizeGeoFilterType GeoFilterType
1482− | NoOptimizeBbox deriving (Eq, Show, Generic, Typeable)
1482+ | NoOptimizeBbox deriving (Eq, Read, Show, Generic, Typeable)
14831483
14841484data Distance =
14851485 Distance { coefficient :: Double
1486− , unit :: DistanceUnit } deriving (Eq, Show, Generic, Typeable)
1486+ , unit :: DistanceUnit } deriving (Eq, Read, Show, Generic, Typeable)
14871487
14881488data DistanceRange =
14891489 DistanceRange { distanceFrom :: Distance
1490− , distanceTo :: Distance } deriving (Eq, Show, Generic, Typeable)
1490+ , distanceTo :: Distance } deriving (Eq, Read, Show, Generic, Typeable)
14911491
14921492data SearchResult a =
14931493 SearchResult { took :: Int
@@ -1495,16 +1495,16 @@ data SearchResult a =
14951495 , shards :: ShardResult
14961496 , searchHits :: SearchHits a
14971497 , aggregations :: Maybe AggregationResults
1498− , scrollId :: Maybe ScrollId } deriving (Eq, Show, Generic, Typeable)
1498+ , scrollId :: Maybe ScrollId } deriving (Eq, Read, Show, Generic, Typeable)
14991499
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)
15011501
15021502type Score = Maybe Double
15031503
15041504data SearchHits a =
15051505 SearchHits { hitsTotal :: Int
15061506 , maxScore :: Score
1507− , hits :: [Hit a] } deriving (Eq, Show, Generic, Typeable)
1507+ , hits :: [Hit a] } deriving (Eq, Read, Show, Generic, Typeable)
15081508
15091509
15101510instance Monoid (SearchHits a) where
@@ -1519,12 +1519,12 @@ data Hit a =
15191519 , hitDocId :: DocId
15201520 , hitScore :: Score
15211521 , hitSource :: Maybe a
1522− , hitHighlight :: Maybe HitHighlight } deriving (Eq, Show, Generic, Typeable)
1522+ , hitHighlight :: Maybe HitHighlight } deriving (Eq, Read, Show, Generic, Typeable)
15231523
15241524data ShardResult =
15251525 ShardResult { shardTotal :: Int
15261526 , shardsSuccessful :: Int
1527− , shardsFailed :: Int } deriving (Eq, Show, Generic, Typeable)
1527+ , shardsFailed :: Int } deriving (Eq, Read, Show, Generic, Typeable)
15281528
15291529type HitHighlight = M.Map Text [Text]
15301530
@@ -1548,25 +1548,25 @@ mkAggregations :: Text -> Aggregation -> Aggregations
15481548mkAggregations name aggregation = M.insert name aggregation emptyAggregations
15491549
15501550data TermOrder = TermOrder{ termSortField :: Text
1551− , termSortOrder :: SortOrder } deriving (Eq, Show, Generic, Typeable)
1551+ , termSortOrder :: SortOrder } deriving (Eq, Read, Show, Generic, Typeable)
15521552
15531553data TermInclusion = TermInclusion Text
1554− | TermPattern Text Text deriving (Eq, Show, Generic, Typeable)
1554+ | TermPattern Text Text deriving (Eq, Read, Show, Generic, Typeable)
15551555
15561556data CollectionMode = BreadthFirst
1557− | DepthFirst deriving (Eq, Show, Generic, Typeable)
1557+ | DepthFirst deriving (Eq, Read, Show, Generic, Typeable)
15581558
15591559data ExecutionHint = Ordinals
15601560 | GlobalOrdinals
15611561 | GlobalOrdinalsHash
15621562 | GlobalOrdinalsLowCardinality
1563− | Map deriving (Eq, Show, Generic, Typeable)
1563+ | Map deriving (Eq, Read, Show, Generic, Typeable)
15641564
15651565data TimeInterval = Weeks
15661566 | Days
15671567 | Hours
15681568 | Minutes
1569− | Seconds deriving (Eq)
1569+ | Seconds deriving (Eq, Read)
15701570
15711571data Interval = Year
15721572 | Quarter
@@ -1576,18 +1576,18 @@ data Interval = Year
15761576 | Hour
15771577 | Minute
15781578 | Second
1579− | FractionalInterval Float TimeInterval deriving (Eq, Show, Generic, Typeable)
1579+ | FractionalInterval Float TimeInterval deriving (Eq, Read, Show, Generic, Typeable)
15801580
15811581data Aggregation = TermsAgg TermsAggregation
15821582 | DateHistogramAgg DateHistogramAggregation
15831583 | ValueCountAgg ValueCountAggregation
15841584 | FilterAgg FilterAggregation
15851585 | DateRangeAgg DateRangeAggregation
1586− | MissingAgg MissingAggregation deriving (Eq, Show, Generic, Typeable)
1586+ | MissingAgg MissingAggregation deriving (Eq, Read, Show, Generic, Typeable)
15871587
15881588data MissingAggregation = MissingAggregation
15891589 { maField :: Text
1590− } deriving (Eq, Show, Generic, Typeable)
1590+ } deriving (Eq, Read, Show, Generic, Typeable)
15911591
15921592data TermsAggregation = TermsAggregation { term :: Either Text Text
15931593 , termInclude :: Maybe TermInclusion
@@ -1599,7 +1599,7 @@ data TermsAggregation = TermsAggregation { term :: Either Text Text
15991599 , termCollectMode :: Maybe CollectionMode
16001600 , termExecutionHint :: Maybe ExecutionHint
16011601 , termAggs :: Maybe Aggregations
1602− } deriving (Eq, Show, Generic, Typeable)
1602+ } deriving (Eq, Read, Show, Generic, Typeable)
16031603
16041604data DateHistogramAggregation = DateHistogramAggregation { dateField :: FieldName
16051605 , dateInterval :: Interval
@@ -1610,29 +1610,29 @@ data DateHistogramAggregation = DateHistogramAggregation { dateField :: Fie
16101610 , datePreOffset :: Maybe Text
16111611 , datePostOffset :: Maybe Text
16121612 , dateAggs :: Maybe Aggregations
1613− } deriving (Eq, Show, Generic, Typeable)
1613+ } deriving (Eq, Read, Show, Generic, Typeable)
16141614
16151615
16161616data DateRangeAggregation = DateRangeAggregation { draField :: FieldName
16171617 , draFormat :: Maybe Text
16181618 , draRanges :: NonEmpty DateRangeAggRange
1619− } deriving (Eq, Show, Generic, Typeable)
1619+ } deriving (Eq, Read, Show, Generic, Typeable)
16201620
16211621data DateRangeAggRange = DateRangeFrom DateMathExpr
16221622 | DateRangeTo DateMathExpr
1623− | DateRangeFromAndTo DateMathExpr DateMathExpr deriving (Eq, Show, Generic, Typeable)
1623+ | DateRangeFromAndTo DateMathExpr DateMathExpr deriving (Eq, Read, Show, Generic, Typeable)
16241624
16251625-- | 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)
16271627
16281628
16291629-- | Starting point for a date range. This along with the 'DateMathModifiers' gets you the date ES will start from.
16301630data DateMathAnchor = DMNow
1631− | DMDate Day deriving (Eq, Show, Generic, Typeable)
1631+ | DMDate Day deriving (Eq, Read, Show, Generic, Typeable)
16321632
16331633data DateMathModifier = AddTime Int DateMathUnit
16341634 | SubtractTime Int DateMathUnit
1635− | RoundDownTo DateMathUnit deriving (Eq, Show, Generic, Typeable)
1635+ | RoundDownTo DateMathUnit deriving (Eq, Read, Show, Generic, Typeable)
16361636
16371637data DateMathUnit = DMYear
16381638 | DMMonth
@@ -1640,15 +1640,15 @@ data DateMathUnit = DMYear
16401640 | DMDay
16411641 | DMHour
16421642 | DMMinute
1643− | DMSecond deriving (Eq, Show, Generic, Typeable)
1643+ | DMSecond deriving (Eq, Read, Show, Generic, Typeable)
16441644
16451645-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html> for more information.
16461646data ValueCountAggregation = FieldValueCount FieldName
1647− | ScriptValueCount Script deriving (Eq, Show, Generic, Typeable)
1647+ | ScriptValueCount Script deriving (Eq, Read, Show, Generic, Typeable)
16481648
16491649-- | 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.
16501650data FilterAggregation = FilterAggregation { faFilter :: Filter
1651− , faAggs :: Maybe Aggregations} deriving (Eq, Show, Generic, Typeable)
1651+ , faAggs :: Maybe Aggregations} deriving (Eq, Read, Show, Generic, Typeable)
16521652
16531653mkTermsAggregation :: Text -> TermsAggregation
16541654mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
@@ -1789,22 +1789,22 @@ class BucketAggregation a where
17891789 aggs :: a -> Maybe AggregationResults
17901790
17911791
1792−data Bucket a = Bucket { buckets :: [a]} deriving (Show)
1792+data Bucket a = Bucket { buckets :: [a]} deriving (Read, Show)
17931793
17941794data BucketValue = TextValue Text
17951795 | ScientificValue Scientific
1796− | BoolValue Bool deriving (Show)
1796+ | BoolValue Bool deriving (Read, Show)
17971797
17981798data MissingResult = MissingResult { missingDocCount :: Int } deriving (Show)
17991799
18001800data TermsResult = TermsResult { termKey :: BucketValue
18011801 , termsDocCount :: Int
1802− , termsAggs :: Maybe AggregationResults } deriving (Show)
1802+ , termsAggs :: Maybe AggregationResults } deriving (Read, Show)
18031803
18041804data DateHistogramResult = DateHistogramResult { dateKey :: Int
18051805 , dateKeyStr :: Maybe Text
18061806 , dateDocCount :: Int
1807− , dateHistogramAggs :: Maybe AggregationResults } deriving (Show)
1807+ , dateHistogramAggs :: Maybe AggregationResults } deriving (Read, Show)
18081808
18091809data DateRangeResult = DateRangeResult { dateRangeKey :: Text
18101810 , dateRangeFrom :: Maybe UTCTime
@@ -1812,7 +1812,7 @@ data DateRangeResult = DateRangeResult { dateRangeKey :: Text
18121812 , dateRangeTo :: Maybe UTCTime
18131813 , dateRangeToAsString :: Maybe Text
18141814 , dateRangeDocCount :: Int
1815− , dateRangeAggs :: Maybe AggregationResults } deriving (Show, Eq, Generic, Typeable)
1815+ , dateRangeAggs :: Maybe AggregationResults } deriving (Read, Show, Eq, Generic, Typeable)
18161816
18171817toTerms :: Text -> AggregationResults -> Maybe (Bucket TermsResult)
18181818toTerms = toAggResult
@@ -3610,7 +3610,7 @@ instance Enum DocVersion where
36103610 enumFromThen = boundedEnumFromThen
36113611
36123612-- | 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)
36143614
36153615-- | 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)