@@ -1,3 +1,4 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
12{-# LANGUAGE DeriveGeneric #-}
23{-# LANGUAGE FlexibleContexts #-}
34{-# LANGUAGE FlexibleInstances #-}
@@ -262,6 +263,7 @@ import Data.Text (Text)
262263import qualified Data.Text as T
263264import Data.Time.Clock (UTCTime)
264265import qualified Data.Traversable as DT
266+import Data.Typeable (Typeable)
265267import qualified Data.Vector as V
266268import GHC.Enum
267269import GHC.Generics (Generic)
@@ -335,7 +337,7 @@ data Version = Version { number :: Text
335337 , build_hash :: Text
336338 , build_timestamp :: UTCTime
337339 , build_snapshot :: Bool
338− , lucene_version :: Text } deriving (Eq, Show, Generic)
340+ , lucene_version :: Text } deriving (Eq, Show, Generic, Typeable)
339341
340342{-| 'Status' is a data type for describing the JSON body returned by
341343 Elasticsearch when you query its status. This was deprecated in 1.2.0.
@@ -451,23 +453,23 @@ data IndexAlias = IndexAlias { srcIndex :: IndexName
451453newtype IndexAliasName = IndexAliasName { indexAliasName :: IndexName } deriving (Eq, Show, ToJSON)
452454
453455data IndexAliasAction = AddAlias IndexAlias IndexAliasCreate
454− | RemoveAlias IndexAlias deriving (Show, Eq)
456+ | RemoveAlias IndexAlias deriving (Show, Eq, Typeable)
455457
456458data IndexAliasCreate = IndexAliasCreate { aliasCreateRouting :: Maybe AliasRouting
457459 , aliasCreateFilter :: Maybe Filter}
458− deriving (Show, Eq)
460+ deriving (Show, Eq, Typeable)
459461
460462data AliasRouting = AllAliasRouting RoutingValue
461463 | GranularAliasRouting (Maybe SearchAliasRouting) (Maybe IndexAliasRouting)
462− deriving (Show, Eq)
464+ deriving (Show, Eq, Typeable)
463465
464−newtype SearchAliasRouting = SearchAliasRouting (NonEmpty RoutingValue) deriving (Show, Eq)
466+newtype SearchAliasRouting = SearchAliasRouting (NonEmpty RoutingValue) deriving (Show, Eq, Typeable)
465467
466−newtype IndexAliasRouting = IndexAliasRouting RoutingValue deriving (Show, Eq, ToJSON, FromJSON)
468+newtype IndexAliasRouting = IndexAliasRouting RoutingValue deriving (Show, Eq, ToJSON, FromJSON, Typeable)
467469
468−newtype RoutingValue = RoutingValue { routingValue :: Text } deriving (Show, Eq, ToJSON, FromJSON)
470+newtype RoutingValue = RoutingValue { routingValue :: Text } deriving (Show, Eq, ToJSON, FromJSON, Typeable)
469471
470−newtype IndexAliasesSummary = IndexAliasesSummary { indexAliasesSummary :: [IndexAliasSummary] } deriving (Show, Eq)
472+newtype IndexAliasesSummary = IndexAliasesSummary { indexAliasesSummary :: [IndexAliasSummary] } deriving (Show, Eq, Typeable)
471473
472474{-| 'IndexAliasSummary' is a summary of an index alias configured for a server. -}
473475data IndexAliasSummary = IndexAliasSummary { indexAliasSummaryAlias :: IndexAlias
@@ -623,15 +625,15 @@ type PrefixValue = Text
623625{-| 'BooleanOperator' is the usual And/Or operators with an ES compatible
624626 JSON encoding baked in. Used all over the place.
625627-}
626−data BooleanOperator = And | Or deriving (Eq, Show)
628+data BooleanOperator = And | Or deriving (Eq, Show, Typeable)
627629
628630{-| 'ShardCount' is part of 'IndexSettings'
629631-}
630−newtype ShardCount = ShardCount Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
632+newtype ShardCount = ShardCount Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
631633
632634{-| 'ReplicaCount' is part of 'IndexSettings'
633635-}
634−newtype ReplicaCount = ReplicaCount Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
636+newtype ReplicaCount = ReplicaCount Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
635637
636638{-| 'Server' is used with the client functions to point at the ES instance
637639-}
@@ -639,35 +641,35 @@ newtype Server = Server Text deriving (Eq, Show)
639641
640642{-| 'IndexName' is used to describe which index to query/create/delete
641643-}
642−newtype IndexName = IndexName Text deriving (Eq, Generic, Show, ToJSON, FromJSON)
644+newtype IndexName = IndexName Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
643645
644646{-| 'TemplateName' is used to describe which template to query/create/delete
645647-}
646−newtype TemplateName = TemplateName Text deriving (Eq, Show, Generic, ToJSON, FromJSON)
648+newtype TemplateName = TemplateName Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
647649
648650{-| 'TemplatePattern' represents a pattern which is matched against index names
649651-}
650−newtype TemplatePattern = TemplatePattern Text deriving (Eq, Show, Generic, ToJSON, FromJSON)
652+newtype TemplatePattern = TemplatePattern Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
651653
652654{-| 'MappingName' is part of mappings which are how ES describes and schematizes
653655 the data in the indices.
654656-}
655−newtype MappingName = MappingName Text deriving (Eq, Generic, Show, ToJSON, FromJSON)
657+newtype MappingName = MappingName Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
656658
657659{-| 'DocId' is a generic wrapper value for expressing unique Document IDs.
658660 Can be set by the user or created by ES itself. Often used in client
659661 functions for poking at specific documents.
660662-}
661−newtype DocId = DocId Text deriving (Eq, Generic, Show, ToJSON, FromJSON)
663+newtype DocId = DocId Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
662664
663665{-| 'QueryString' is used to wrap query text bodies, be they human written or not.
664666-}
665−newtype QueryString = QueryString Text deriving (Eq, Generic, Show, ToJSON, FromJSON)
667+newtype QueryString = QueryString Text deriving (Eq, Generic, Show, ToJSON, FromJSON, Typeable)
666668
667669{-| 'FieldName' is used all over the place wherever a specific field within
668670 a document needs to be specified, usually in 'Query's or 'Filter's.
669671-}
670−newtype FieldName = FieldName Text deriving (Eq, Show, ToJSON, FromJSON)
672+newtype FieldName = FieldName Text deriving (Eq, Show, ToJSON, FromJSON, Typeable)
671673
672674
673675{-| 'Script' is often used in place of 'FieldName' to specify more
@@ -678,98 +680,98 @@ newtype Script = Script { scriptText :: Text } deriving (Eq, Show)
678680{-| 'CacheName' is used in 'RegexpFilter' for describing the
679681 'CacheKey' keyed caching behavior.
680682-}
681−newtype CacheName = CacheName Text deriving (Eq, Show, ToJSON, FromJSON)
683+newtype CacheName = CacheName Text deriving (Eq, Show, ToJSON, FromJSON, Typeable)
682684
683685{-| 'CacheKey' is used in 'RegexpFilter' to key regex caching.
684686-}
685687newtype CacheKey =
686− CacheKey Text deriving (Eq, Show, ToJSON, FromJSON)
688+ CacheKey Text deriving (Eq, Show, ToJSON, FromJSON, Typeable)
687689newtype Existence =
688− Existence Bool deriving (Eq, Show, ToJSON, FromJSON)
690+ Existence Bool deriving (Eq, Show, ToJSON, FromJSON, Typeable)
689691newtype NullValue =
690− NullValue Bool deriving (Eq, Show, ToJSON, FromJSON)
692+ NullValue Bool deriving (Eq, Show, ToJSON, FromJSON, Typeable)
691693newtype CutoffFrequency =
692− CutoffFrequency Double deriving (Eq, Show, Generic, ToJSON, FromJSON)
694+ CutoffFrequency Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
693695newtype Analyzer =
694− Analyzer Text deriving (Eq, Show, Generic, ToJSON, FromJSON)
696+ Analyzer Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
695697newtype MaxExpansions =
696− MaxExpansions Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
698+ MaxExpansions Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
697699
698700{-| 'Lenient', if set to true, will cause format based failures to be
699701 ignored. I don't know what the bloody default is, Elasticsearch
700702 documentation didn't say what it was. Let me know if you figure it out.
701703-}
702704newtype Lenient =
703− Lenient Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
705+ Lenient Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
704706newtype Tiebreaker =
705− Tiebreaker Double deriving (Eq, Show, Generic, ToJSON, FromJSON)
707+ Tiebreaker Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
706708newtype Boost =
707− Boost Double deriving (Eq, Show, Generic, ToJSON, FromJSON)
709+ Boost Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
708710newtype BoostTerms =
709− BoostTerms Double deriving (Eq, Show, Generic, ToJSON, FromJSON)
711+ BoostTerms Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
710712
711713{-| 'MinimumMatch' controls how many should clauses in the bool query should
712714 match. Can be an absolute value (2) or a percentage (30%) or a
713715 combination of both.
714716-}
715717newtype MinimumMatch =
716− MinimumMatch Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
718+ MinimumMatch Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
717719newtype DisableCoord =
718− DisableCoord Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
720+ DisableCoord Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
719721newtype IgnoreTermFrequency =
720− IgnoreTermFrequency Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
722+ IgnoreTermFrequency Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
721723newtype MinimumTermFrequency =
722− MinimumTermFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
724+ MinimumTermFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
723725newtype MaxQueryTerms =
724− MaxQueryTerms Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
726+ MaxQueryTerms Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
725727newtype Fuzziness =
726− Fuzziness Double deriving (Eq, Show, Generic, ToJSON, FromJSON)
728+ Fuzziness Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
727729
728730{-| 'PrefixLength' is the prefix length used in queries, defaults to 0. -}
729731newtype PrefixLength =
730− PrefixLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
732+ PrefixLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
731733newtype TypeName =
732− TypeName Text deriving (Eq, Show, Generic, ToJSON, FromJSON)
734+ TypeName Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
733735newtype PercentMatch =
734− PercentMatch Double deriving (Eq, Show, Generic, ToJSON, FromJSON)
736+ PercentMatch Double deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
735737newtype StopWord =
736− StopWord Text deriving (Eq, Show, Generic, ToJSON, FromJSON)
738+ StopWord Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
737739newtype QueryPath =
738− QueryPath Text deriving (Eq, Show, Generic, ToJSON, FromJSON)
740+ QueryPath Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
739741
740742{-| Allowing a wildcard at the beginning of a word (eg "*ing") is particularly
741743 heavy, because all terms in the index need to be examined, just in case
742744 they match. Leading wildcards can be disabled by setting
743745 'AllowLeadingWildcard' to false. -}
744746newtype AllowLeadingWildcard =
745− AllowLeadingWildcard Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
747+ AllowLeadingWildcard Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
746748newtype LowercaseExpanded =
747− LowercaseExpanded Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
749+ LowercaseExpanded Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
748750newtype EnablePositionIncrements =
749− EnablePositionIncrements Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
751+ EnablePositionIncrements Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
750752
751753{-| By default, wildcard terms in a query are not analyzed.
752754 Setting 'AnalyzeWildcard' to true enables best-effort analysis.
753755-}
754−newtype AnalyzeWildcard = AnalyzeWildcard Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
756+newtype AnalyzeWildcard = AnalyzeWildcard Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
755757
756758{-| 'GeneratePhraseQueries' defaults to false.
757759-}
758760newtype GeneratePhraseQueries =
759− GeneratePhraseQueries Bool deriving (Eq, Show, Generic, ToJSON, FromJSON)
761+ GeneratePhraseQueries Bool deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
760762
761763{-| 'Locale' is used for string conversions - defaults to ROOT.
762764-}
763−newtype Locale = Locale Text deriving (Eq, Show, Generic, ToJSON, FromJSON)
764−newtype MaxWordLength = MaxWordLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
765−newtype MinWordLength = MinWordLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
765+newtype Locale = Locale Text deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
766+newtype MaxWordLength = MaxWordLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
767+newtype MinWordLength = MinWordLength Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
766768
767769{-| 'PhraseSlop' sets the default slop for phrases, 0 means exact
768770 phrase matches. Default is 0.
769771-}
770−newtype PhraseSlop = PhraseSlop Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
771−newtype MinDocFrequency = MinDocFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
772−newtype MaxDocFrequency = MaxDocFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON)
772+newtype PhraseSlop = PhraseSlop Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
773+newtype MinDocFrequency = MinDocFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
774+newtype MaxDocFrequency = MaxDocFrequency Int deriving (Eq, Show, Generic, ToJSON, FromJSON, Typeable)
773775
774776{-| 'unpackId' is a silly convenience function that gets used once.
775777-}
@@ -898,19 +900,19 @@ data Query =
898900 | QuerySimpleQueryStringQuery SimpleQueryStringQuery
899901 | QueryRangeQuery RangeQuery
900902 | QueryRegexpQuery RegexpQuery
901− deriving (Eq, Show)
903+ deriving (Eq, Show, Typeable)
902904
903905data RegexpQuery =
904906 RegexpQuery { regexpQueryField :: FieldName
905907 , regexpQuery :: Regexp
906908 , regexpQueryFlags :: RegexpFlags
907909 , regexpQueryBoost :: Maybe Boost
908− } deriving (Eq, Show)
910+ } deriving (Eq, Show, Typeable)
909911
910912data RangeQuery =
911913 RangeQuery { rangeQueryField :: FieldName
912914 , rangeQueryRange :: RangeValue
913− , rangeQueryBoost :: Boost } deriving (Eq, Show)
915+ , rangeQueryBoost :: Boost } deriving (Eq, Show, Typeable)
914916
915917mkRangeQuery :: FieldName -> RangeValue -> RangeQuery
916918mkRangeQuery f r = RangeQuery f r (Boost 1.0)
@@ -938,7 +940,7 @@ data SimpleQueryFlag =
938940 | SimpleQueryWhitespace
939941 | SimpleQueryFuzzy
940942 | SimpleQueryNear
941− | SimpleQuerySlop deriving (Eq, Show)
943+ | SimpleQuerySlop deriving (Eq, Show, Typeable)
942944
943945-- use_dis_max and tie_breaker when fields are plural?
944946data QueryStringQuery =
@@ -960,7 +962,7 @@ data QueryStringQuery =
960962 , queryStringMinimumShouldMatch :: Maybe MinimumMatch
961963 , queryStringLenient :: Maybe Lenient
962964 , queryStringLocale :: Maybe Locale
963− } deriving (Eq, Show)
965+ } deriving (Eq, Show, Typeable)
964966
965967mkQueryStringQuery :: QueryString -> QueryStringQuery
966968mkQueryStringQuery qs =
@@ -971,19 +973,19 @@ mkQueryStringQuery qs =
971973 Nothing Nothing
972974
973975data FieldOrFields = FofField FieldName
974− | FofFields (NonEmpty FieldName) deriving (Eq, Show)
976+ | FofFields (NonEmpty FieldName) deriving (Eq, Show, Typeable)
975977
976978data PrefixQuery =
977979 PrefixQuery
978980 { prefixQueryField :: FieldName
979981 , prefixQueryPrefixValue :: Text
980− , prefixQueryBoost :: Maybe Boost } deriving (Eq, Show)
982+ , prefixQueryBoost :: Maybe Boost } deriving (Eq, Show, Typeable)
981983
982984data NestedQuery =
983985 NestedQuery
984986 { nestedQueryPath :: QueryPath
985987 , nestedQueryScoreType :: ScoreType
986− , nestedQuery :: Query } deriving (Eq, Show)
988+ , nestedQuery :: Query } deriving (Eq, Show, Typeable)
987989
988990data MoreLikeThisFieldQuery =
989991 MoreLikeThisFieldQuery
@@ -1001,7 +1003,7 @@ data MoreLikeThisFieldQuery =
10011003 , moreLikeThisFieldBoostTerms :: Maybe BoostTerms
10021004 , moreLikeThisFieldBoost :: Maybe Boost
10031005 , moreLikeThisFieldAnalyzer :: Maybe Analyzer
1004− } deriving (Eq, Show)
1006+ } deriving (Eq, Show, Typeable)
10051007
10061008data MoreLikeThisQuery =
10071009 MoreLikeThisQuery
@@ -1019,32 +1021,32 @@ data MoreLikeThisQuery =
10191021 , moreLikeThisBoostTerms :: Maybe BoostTerms
10201022 , moreLikeThisBoost :: Maybe Boost
10211023 , moreLikeThisAnalyzer :: Maybe Analyzer
1022− } deriving (Eq, Show)
1024+ } deriving (Eq, Show, Typeable)
10231025
10241026data IndicesQuery =
10251027 IndicesQuery
10261028 { indicesQueryIndices :: [IndexName]
10271029 , indicesQuery :: Query
10281030 -- default "all"
1029− , indicesQueryNoMatch :: Maybe Query } deriving (Eq, Show)
1031+ , indicesQueryNoMatch :: Maybe Query } deriving (Eq, Show, Typeable)
10301032
10311033data HasParentQuery =
10321034 HasParentQuery
10331035 { hasParentQueryType :: TypeName
10341036 , hasParentQuery :: Query
1035− , hasParentQueryScoreType :: Maybe ScoreType } deriving (Eq, Show)
1037+ , hasParentQueryScoreType :: Maybe ScoreType } deriving (Eq, Show, Typeable)
10361038
10371039data HasChildQuery =
10381040 HasChildQuery
10391041 { hasChildQueryType :: TypeName
10401042 , hasChildQuery :: Query
1041− , hasChildQueryScoreType :: Maybe ScoreType } deriving (Eq, Show)
1043+ , hasChildQueryScoreType :: Maybe ScoreType } deriving (Eq, Show, Typeable)
10421044
10431045data ScoreType =
10441046 ScoreTypeMax
10451047 | ScoreTypeSum
10461048 | ScoreTypeAvg
1047− | ScoreTypeNone deriving (Eq, Show)
1049+ | ScoreTypeNone deriving (Eq, Show, Typeable)
10481050
10491051data FuzzyQuery =
10501052 FuzzyQuery { fuzzyQueryField :: FieldName
@@ -1053,7 +1055,7 @@ data FuzzyQuery =
10531055 , fuzzyQueryMaxExpansions :: MaxExpansions
10541056 , fuzzyQueryFuzziness :: Fuzziness
10551057 , fuzzyQueryBoost :: Maybe Boost
1056− } deriving (Eq, Show)
1058+ } deriving (Eq, Show, Typeable)
10571059
10581060data FuzzyLikeFieldQuery =
10591061 FuzzyLikeFieldQuery
@@ -1078,19 +1080,19 @@ data FuzzyLikeThisQuery =
10781080 , fuzzyLikePrefixLength :: PrefixLength
10791081 , fuzzyLikeBoost :: Boost
10801082 , fuzzyLikeAnalyzer :: Maybe Analyzer
1081− } deriving (Eq, Show)
1083+ } deriving (Eq, Show, Typeable)
10821084
10831085data FilteredQuery =
10841086 FilteredQuery
10851087 { filteredQuery :: Query
1086− , filteredFilter :: Filter } deriving (Eq, Show)
1088+ , filteredFilter :: Filter } deriving (Eq, Show, Typeable)
10871089
10881090data DisMaxQuery =
10891091 DisMaxQuery { disMaxQueries :: [Query]
10901092 -- default 0.0
10911093 , disMaxTiebreaker :: Tiebreaker
10921094 , disMaxBoost :: Maybe Boost
1093− } deriving (Eq, Show)
1095+ } deriving (Eq, Show, Typeable)
10941096
10951097data MatchQuery =
10961098 MatchQuery { matchQueryField :: FieldName
@@ -1102,7 +1104,7 @@ data MatchQuery =
11021104 , matchQueryAnalyzer :: Maybe Analyzer
11031105 , matchQueryMaxExpansions :: Maybe MaxExpansions
11041106 , matchQueryLenient :: Maybe Lenient
1105− , matchQueryBoost :: Maybe Boost } deriving (Eq, Show)
1107+ , matchQueryBoost :: Maybe Boost } deriving (Eq, Show, Typeable)
11061108
11071109{-| 'mkMatchQuery' is a convenience function that defaults the less common parameters,
11081110 enabling you to provide only the 'FieldName' and 'QueryString' to make a 'MatchQuery'
@@ -1112,7 +1114,7 @@ mkMatchQuery field query = MatchQuery field query Or ZeroTermsNone Nothing Nothi
11121114
11131115data MatchQueryType =
11141116 MatchPhrase
1115− | MatchPhrasePrefix deriving (Eq, Show)
1117+ | MatchPhrasePrefix deriving (Eq, Show, Typeable)
11161118
11171119data MultiMatchQuery =
11181120 MultiMatchQuery { multiMatchQueryFields :: [FieldName]
@@ -1124,7 +1126,7 @@ data MultiMatchQuery =
11241126 , multiMatchQueryCutoffFrequency :: Maybe CutoffFrequency
11251127 , multiMatchQueryAnalyzer :: Maybe Analyzer
11261128 , multiMatchQueryMaxExpansions :: Maybe MaxExpansions
1127− , multiMatchQueryLenient :: Maybe Lenient } deriving (Eq, Show)
1129+ , multiMatchQueryLenient :: Maybe Lenient } deriving (Eq, Show, Typeable)
11281130
11291131{-| 'mkMultiMatchQuery' is a convenience function that defaults the less common parameters,
11301132 enabling you to provide only the list of 'FieldName's and 'QueryString' to
@@ -1141,7 +1143,7 @@ data MultiMatchQueryType =
11411143 | MultiMatchMostFields
11421144 | MultiMatchCrossFields
11431145 | MultiMatchPhrase
1144− | MultiMatchPhrasePrefix deriving (Eq, Show)
1146+ | MultiMatchPhrasePrefix deriving (Eq, Show, Typeable)
11451147
11461148data BoolQuery =
11471149 BoolQuery { boolQueryMustMatch :: [Query]
@@ -1150,7 +1152,7 @@ data BoolQuery =
11501152 , boolQueryMinimumShouldMatch :: Maybe MinimumMatch
11511153 , boolQueryBoost :: Maybe Boost
11521154 , boolQueryDisableCoord :: Maybe DisableCoord
1153− } deriving (Eq, Show)
1155+ } deriving (Eq, Show, Typeable)
11541156
11551157mkBoolQuery :: [Query] -> [Query] -> [Query] -> BoolQuery
11561158mkBoolQuery must mustNot should =
@@ -1159,7 +1161,7 @@ mkBoolQuery must mustNot should =
11591161data BoostingQuery =
11601162 BoostingQuery { positiveQuery :: Query
11611163 , negativeQuery :: Query
1162− , negativeBoost :: Boost } deriving (Eq, Show)
1164+ , negativeBoost :: Boost } deriving (Eq, Show, Typeable)
11631165
11641166data CommonTermsQuery =
11651167 CommonTermsQuery { commonField :: FieldName
@@ -1171,16 +1173,16 @@ data CommonTermsQuery =
11711173 , commonBoost :: Maybe Boost
11721174 , commonAnalyzer :: Maybe Analyzer
11731175 , commonDisableCoord :: Maybe DisableCoord
1174− } deriving (Eq, Show)
1176+ } deriving (Eq, Show, Typeable)
11751177
11761178data CommonMinimumMatch =
11771179 CommonMinimumMatchHighLow MinimumMatchHighLow
11781180 | CommonMinimumMatch MinimumMatch
1179− deriving (Eq, Show)
1181+ deriving (Eq, Show, Typeable)
11801182
11811183data MinimumMatchHighLow =
11821184 MinimumMatchHighLow { lowFreq :: MinimumMatch
1183− , highFreq :: MinimumMatch } deriving (Eq, Show)
1185+ , highFreq :: MinimumMatch } deriving (Eq, Show, Typeable)
11841186
11851187data Filter = AndFilter [Filter] Cache
11861188 | OrFilter [Filter] Cache
@@ -1200,13 +1202,13 @@ data Filter = AndFilter [Filter] Cache
12001202 | RangeFilter FieldName RangeValue RangeExecution Cache
12011203 | RegexpFilter FieldName Regexp RegexpFlags CacheName Cache CacheKey
12021204 | TermFilter Term Cache
1203− deriving (Eq, Show)
1205+ deriving (Eq, Show, Typeable)
12041206
12051207data ZeroTermsQuery = ZeroTermsNone
1206− | ZeroTermsAll deriving (Eq, Show)
1208+ | ZeroTermsAll deriving (Eq, Show, Typeable)
12071209
12081210data RangeExecution = RangeExecutionIndex
1209− | RangeExecutionFielddata deriving (Eq, Show)
1211+ | RangeExecutionFielddata deriving (Eq, Show, Typeable)
12101212
12111213newtype Regexp = Regexp Text deriving (Eq, Show, FromJSON)
12121214
@@ -1269,33 +1271,33 @@ rangeValueToPair rv = case rv of
12691271 RangeDoubleGtLt (GreaterThan l) (LessThan g) -> ["gt" .= l, "lt" .= g]
12701272
12711273data Term = Term { termField :: Text
1272− , termValue :: Text } deriving (Eq, Show)
1274+ , termValue :: Text } deriving (Eq, Show, Typeable)
12731275
12741276data BoolMatch = MustMatch Term Cache
12751277 | MustNotMatch Term Cache
1276− | ShouldMatch [Term] Cache deriving (Eq, Show)
1278+ | ShouldMatch [Term] Cache deriving (Eq, Show, Typeable)
12771279
12781280-- "memory" or "indexed"
12791281data GeoFilterType = GeoFilterMemory
1280− | GeoFilterIndexed deriving (Eq, Show)
1282+ | GeoFilterIndexed deriving (Eq, Show, Typeable)
12811283
12821284data LatLon = LatLon { lat :: Double
1283− , lon :: Double } deriving (Eq, Show)
1285+ , lon :: Double } deriving (Eq, Show, Typeable)
12841286
12851287data GeoBoundingBox =
12861288 GeoBoundingBox { topLeft :: LatLon
1287− , bottomRight :: LatLon } deriving (Eq, Show)
1289+ , bottomRight :: LatLon } deriving (Eq, Show, Typeable)
12881290
12891291data GeoBoundingBoxConstraint =
12901292 GeoBoundingBoxConstraint { geoBBField :: FieldName
12911293 , constraintBox :: GeoBoundingBox
12921294 , bbConstraintcache :: Cache
12931295 , geoType :: GeoFilterType
1294− } deriving (Eq, Show)
1296+ } deriving (Eq, Show, Typeable)
12951297
12961298data GeoPoint =
12971299 GeoPoint { geoField :: FieldName
1298− , latLon :: LatLon} deriving (Eq, Show)
1300+ , latLon :: LatLon} deriving (Eq, Show, Typeable)
12991301
13001302data DistanceUnit = Miles
13011303 | Yards
@@ -1305,18 +1307,18 @@ data DistanceUnit = Miles
13051307 | Meters
13061308 | Centimeters
13071309 | Millimeters
1308− | NauticalMiles deriving (Eq, Show)
1310+ | NauticalMiles deriving (Eq, Show, Typeable)
13091311
13101312data DistanceType = Arc
13111313 | SloppyArc -- doesn't exist <1.0
1312− | Plane deriving (Eq, Show)
1314+ | Plane deriving (Eq, Show, Typeable)
13131315
13141316data OptimizeBbox = OptimizeGeoFilterType GeoFilterType
1315− | NoOptimizeBbox deriving (Eq, Show)
1317+ | NoOptimizeBbox deriving (Eq, Show, Typeable)
13161318
13171319data Distance =
13181320 Distance { coefficient :: Double
1319− , unit :: DistanceUnit } deriving (Eq, Show)
1321+ , unit :: DistanceUnit } deriving (Eq, Show, Typeable)
13201322
13211323data DistanceRange =
13221324 DistanceRange { distanceFrom :: Distance