{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings          #-}

module Database.Bloodhound.Internal.Newtypes where

import           Bloodhound.Import

import qualified Data.Map.Strict as M

newtype From = From Int deriving (From -> From -> Bool
(From -> From -> Bool) -> (From -> From -> Bool) -> Eq From
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: From -> From -> Bool
$c/= :: From -> From -> Bool
== :: From -> From -> Bool
$c== :: From -> From -> Bool
Eq, Int -> From -> ShowS
[From] -> ShowS
From -> String
(Int -> From -> ShowS)
-> (From -> String) -> ([From] -> ShowS) -> Show From
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [From] -> ShowS
$cshowList :: [From] -> ShowS
show :: From -> String
$cshow :: From -> String
showsPrec :: Int -> From -> ShowS
$cshowsPrec :: Int -> From -> ShowS
Show, [From] -> Encoding
[From] -> Value
From -> Encoding
From -> Value
(From -> Value)
-> (From -> Encoding)
-> ([From] -> Value)
-> ([From] -> Encoding)
-> ToJSON From
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [From] -> Encoding
$ctoEncodingList :: [From] -> Encoding
toJSONList :: [From] -> Value
$ctoJSONList :: [From] -> Value
toEncoding :: From -> Encoding
$ctoEncoding :: From -> Encoding
toJSON :: From -> Value
$ctoJSON :: From -> Value
ToJSON)
newtype Size = Size Int deriving (Size -> Size -> Bool
(Size -> Size -> Bool) -> (Size -> Size -> Bool) -> Eq Size
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Size -> Size -> Bool
$c/= :: Size -> Size -> Bool
== :: Size -> Size -> Bool
$c== :: Size -> Size -> Bool
Eq, Int -> Size -> ShowS
[Size] -> ShowS
Size -> String
(Int -> Size -> ShowS)
-> (Size -> String) -> ([Size] -> ShowS) -> Show Size
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Size] -> ShowS
$cshowList :: [Size] -> ShowS
show :: Size -> String
$cshow :: Size -> String
showsPrec :: Int -> Size -> ShowS
$cshowsPrec :: Int -> Size -> ShowS
Show, [Size] -> Encoding
[Size] -> Value
Size -> Encoding
Size -> Value
(Size -> Value)
-> (Size -> Encoding)
-> ([Size] -> Value)
-> ([Size] -> Encoding)
-> ToJSON Size
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Size] -> Encoding
$ctoEncodingList :: [Size] -> Encoding
toJSONList :: [Size] -> Value
$ctoJSONList :: [Size] -> Value
toEncoding :: Size -> Encoding
$ctoEncoding :: Size -> Encoding
toJSON :: Size -> Value
$ctoJSON :: Size -> Value
ToJSON, Value -> Parser [Size]
Value -> Parser Size
(Value -> Parser Size) -> (Value -> Parser [Size]) -> FromJSON Size
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Size]
$cparseJSONList :: Value -> Parser [Size]
parseJSON :: Value -> Parser Size
$cparseJSON :: Value -> Parser Size
FromJSON)

-- Used with scripts
newtype HitFields =
  HitFields (M.Map Text [Value])
  deriving (HitFields -> HitFields -> Bool
(HitFields -> HitFields -> Bool)
-> (HitFields -> HitFields -> Bool) -> Eq HitFields
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HitFields -> HitFields -> Bool
$c/= :: HitFields -> HitFields -> Bool
== :: HitFields -> HitFields -> Bool
$c== :: HitFields -> HitFields -> Bool
Eq, Int -> HitFields -> ShowS
[HitFields] -> ShowS
HitFields -> String
(Int -> HitFields -> ShowS)
-> (HitFields -> String)
-> ([HitFields] -> ShowS)
-> Show HitFields
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HitFields] -> ShowS
$cshowList :: [HitFields] -> ShowS
show :: HitFields -> String
$cshow :: HitFields -> String
showsPrec :: Int -> HitFields -> ShowS
$cshowsPrec :: Int -> HitFields -> ShowS
Show)

instance FromJSON HitFields where
  parseJSON :: Value -> Parser HitFields
parseJSON Value
x
    = Map Text [Value] -> HitFields
HitFields (Map Text [Value] -> HitFields)
-> Parser (Map Text [Value]) -> Parser HitFields
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser (Map Text [Value])
forall a. FromJSON a => Value -> Parser a
parseJSON Value
x

-- Slight misnomer.
type Score = Maybe Double

newtype ShardId = ShardId { ShardId -> Int
shardId :: Int }
                deriving (ShardId -> ShardId -> Bool
(ShardId -> ShardId -> Bool)
-> (ShardId -> ShardId -> Bool) -> Eq ShardId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShardId -> ShardId -> Bool
$c/= :: ShardId -> ShardId -> Bool
== :: ShardId -> ShardId -> Bool
$c== :: ShardId -> ShardId -> Bool
Eq, Int -> ShardId -> ShowS
[ShardId] -> ShowS
ShardId -> String
(Int -> ShardId -> ShowS)
-> (ShardId -> String) -> ([ShardId] -> ShowS) -> Show ShardId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShardId] -> ShowS
$cshowList :: [ShardId] -> ShowS
show :: ShardId -> String
$cshow :: ShardId -> String
showsPrec :: Int -> ShardId -> ShowS
$cshowsPrec :: Int -> ShardId -> ShowS
Show, Value -> Parser [ShardId]
Value -> Parser ShardId
(Value -> Parser ShardId)
-> (Value -> Parser [ShardId]) -> FromJSON ShardId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ShardId]
$cparseJSONList :: Value -> Parser [ShardId]
parseJSON :: Value -> Parser ShardId
$cparseJSON :: Value -> Parser ShardId
FromJSON)

{-| 'DocId' is a generic wrapper value for expressing unique Document IDs.
    Can be set by the user or created by ES itself. Often used in client
    functions for poking at specific documents.
-}
newtype DocId =
  DocId Text
  deriving (DocId -> DocId -> Bool
(DocId -> DocId -> Bool) -> (DocId -> DocId -> Bool) -> Eq DocId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocId -> DocId -> Bool
$c/= :: DocId -> DocId -> Bool
== :: DocId -> DocId -> Bool
$c== :: DocId -> DocId -> Bool
Eq, Int -> DocId -> ShowS
[DocId] -> ShowS
DocId -> String
(Int -> DocId -> ShowS)
-> (DocId -> String) -> ([DocId] -> ShowS) -> Show DocId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocId] -> ShowS
$cshowList :: [DocId] -> ShowS
show :: DocId -> String
$cshow :: DocId -> String
showsPrec :: Int -> DocId -> ShowS
$cshowsPrec :: Int -> DocId -> ShowS
Show, [DocId] -> Encoding
[DocId] -> Value
DocId -> Encoding
DocId -> Value
(DocId -> Value)
-> (DocId -> Encoding)
-> ([DocId] -> Value)
-> ([DocId] -> Encoding)
-> ToJSON DocId
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [DocId] -> Encoding
$ctoEncodingList :: [DocId] -> Encoding
toJSONList :: [DocId] -> Value
$ctoJSONList :: [DocId] -> Value
toEncoding :: DocId -> Encoding
$ctoEncoding :: DocId -> Encoding
toJSON :: DocId -> Value
$ctoJSON :: DocId -> Value
ToJSON, Value -> Parser [DocId]
Value -> Parser DocId
(Value -> Parser DocId)
-> (Value -> Parser [DocId]) -> FromJSON DocId
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [DocId]
$cparseJSONList :: Value -> Parser [DocId]
parseJSON :: Value -> Parser DocId
$cparseJSON :: Value -> Parser DocId
FromJSON)

{-| 'FieldName' is used all over the place wherever a specific field within
     a document needs to be specified, usually in 'Query's or 'Filter's.
-}
newtype FieldName =
  FieldName Text
  deriving (FieldName -> FieldName -> Bool
(FieldName -> FieldName -> Bool)
-> (FieldName -> FieldName -> Bool) -> Eq FieldName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldName -> FieldName -> Bool
$c/= :: FieldName -> FieldName -> Bool
== :: FieldName -> FieldName -> Bool
$c== :: FieldName -> FieldName -> Bool
Eq, ReadPrec [FieldName]
ReadPrec FieldName
Int -> ReadS FieldName
ReadS [FieldName]
(Int -> ReadS FieldName)
-> ReadS [FieldName]
-> ReadPrec FieldName
-> ReadPrec [FieldName]
-> Read FieldName
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FieldName]
$creadListPrec :: ReadPrec [FieldName]
readPrec :: ReadPrec FieldName
$creadPrec :: ReadPrec FieldName
readList :: ReadS [FieldName]
$creadList :: ReadS [FieldName]
readsPrec :: Int -> ReadS FieldName
$creadsPrec :: Int -> ReadS FieldName
Read, Int -> FieldName -> ShowS
[FieldName] -> ShowS
FieldName -> String
(Int -> FieldName -> ShowS)
-> (FieldName -> String)
-> ([FieldName] -> ShowS)
-> Show FieldName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldName] -> ShowS
$cshowList :: [FieldName] -> ShowS
show :: FieldName -> String
$cshow :: FieldName -> String
showsPrec :: Int -> FieldName -> ShowS
$cshowsPrec :: Int -> FieldName -> ShowS
Show, [FieldName] -> Encoding
[FieldName] -> Value
FieldName -> Encoding
FieldName -> Value
(FieldName -> Value)
-> (FieldName -> Encoding)
-> ([FieldName] -> Value)
-> ([FieldName] -> Encoding)
-> ToJSON FieldName
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [FieldName] -> Encoding
$ctoEncodingList :: [FieldName] -> Encoding
toJSONList :: [FieldName] -> Value
$ctoJSONList :: [FieldName] -> Value
toEncoding :: FieldName -> Encoding
$ctoEncoding :: FieldName -> Encoding
toJSON :: FieldName -> Value
$ctoJSON :: FieldName -> Value
ToJSON, Value -> Parser [FieldName]
Value -> Parser FieldName
(Value -> Parser FieldName)
-> (Value -> Parser [FieldName]) -> FromJSON FieldName
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [FieldName]
$cparseJSONList :: Value -> Parser [FieldName]
parseJSON :: Value -> Parser FieldName
$cparseJSON :: Value -> Parser FieldName
FromJSON)

{- | 'RelationName' describes a relation role between parend and child Documents
     in a Join relarionship: https://www.elastic.co/guide/en/elasticsearch/reference/current/parent-join.html
-}
newtype RelationName =
  RelationName Text
  deriving (RelationName -> RelationName -> Bool
(RelationName -> RelationName -> Bool)
-> (RelationName -> RelationName -> Bool) -> Eq RelationName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelationName -> RelationName -> Bool
$c/= :: RelationName -> RelationName -> Bool
== :: RelationName -> RelationName -> Bool
$c== :: RelationName -> RelationName -> Bool
Eq, ReadPrec [RelationName]
ReadPrec RelationName
Int -> ReadS RelationName
ReadS [RelationName]
(Int -> ReadS RelationName)
-> ReadS [RelationName]
-> ReadPrec RelationName
-> ReadPrec [RelationName]
-> Read RelationName
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RelationName]
$creadListPrec :: ReadPrec [RelationName]
readPrec :: ReadPrec RelationName
$creadPrec :: ReadPrec RelationName
readList :: ReadS [RelationName]
$creadList :: ReadS [RelationName]
readsPrec :: Int -> ReadS RelationName
$creadsPrec :: Int -> ReadS RelationName
Read, Int -> RelationName -> ShowS
[RelationName] -> ShowS
RelationName -> String
(Int -> RelationName -> ShowS)
-> (RelationName -> String)
-> ([RelationName] -> ShowS)
-> Show RelationName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelationName] -> ShowS
$cshowList :: [RelationName] -> ShowS
show :: RelationName -> String
$cshow :: RelationName -> String
showsPrec :: Int -> RelationName -> ShowS
$cshowsPrec :: Int -> RelationName -> ShowS
Show, [RelationName] -> Encoding
[RelationName] -> Value
RelationName -> Encoding
RelationName -> Value
(RelationName -> Value)
-> (RelationName -> Encoding)
-> ([RelationName] -> Value)
-> ([RelationName] -> Encoding)
-> ToJSON RelationName
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [RelationName] -> Encoding
$ctoEncodingList :: [RelationName] -> Encoding
toJSONList :: [RelationName] -> Value
$ctoJSONList :: [RelationName] -> Value
toEncoding :: RelationName -> Encoding
$ctoEncoding :: RelationName -> Encoding
toJSON :: RelationName -> Value
$ctoJSON :: RelationName -> Value
ToJSON, Value -> Parser [RelationName]
Value -> Parser RelationName
(Value -> Parser RelationName)
-> (Value -> Parser [RelationName]) -> FromJSON RelationName
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [RelationName]
$cparseJSONList :: Value -> Parser [RelationName]
parseJSON :: Value -> Parser RelationName
$cparseJSON :: Value -> Parser RelationName
FromJSON)

{-| 'QueryString' is used to wrap query text bodies, be they human written or not.
-}
newtype QueryString =
  QueryString Text
  deriving (QueryString -> QueryString -> Bool
(QueryString -> QueryString -> Bool)
-> (QueryString -> QueryString -> Bool) -> Eq QueryString
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueryString -> QueryString -> Bool
$c/= :: QueryString -> QueryString -> Bool
== :: QueryString -> QueryString -> Bool
$c== :: QueryString -> QueryString -> Bool
Eq, Int -> QueryString -> ShowS
[QueryString] -> ShowS
QueryString -> String
(Int -> QueryString -> ShowS)
-> (QueryString -> String)
-> ([QueryString] -> ShowS)
-> Show QueryString
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueryString] -> ShowS
$cshowList :: [QueryString] -> ShowS
show :: QueryString -> String
$cshow :: QueryString -> String
showsPrec :: Int -> QueryString -> ShowS
$cshowsPrec :: Int -> QueryString -> ShowS
Show, [QueryString] -> Encoding
[QueryString] -> Value
QueryString -> Encoding
QueryString -> Value
(QueryString -> Value)
-> (QueryString -> Encoding)
-> ([QueryString] -> Value)
-> ([QueryString] -> Encoding)
-> ToJSON QueryString
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [QueryString] -> Encoding
$ctoEncodingList :: [QueryString] -> Encoding
toJSONList :: [QueryString] -> Value
$ctoJSONList :: [QueryString] -> Value
toEncoding :: QueryString -> Encoding
$ctoEncoding :: QueryString -> Encoding
toJSON :: QueryString -> Value
$ctoJSON :: QueryString -> Value
ToJSON, Value -> Parser [QueryString]
Value -> Parser QueryString
(Value -> Parser QueryString)
-> (Value -> Parser [QueryString]) -> FromJSON QueryString
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [QueryString]
$cparseJSONList :: Value -> Parser [QueryString]
parseJSON :: Value -> Parser QueryString
$cparseJSON :: Value -> Parser QueryString
FromJSON)


-- {-| 'Script' is often used in place of 'FieldName' to specify more
-- complex ways of extracting a value from a document.
-- -}
-- newtype Script =
--   Script { scriptText :: Text }
--   deriving (Eq, Show)

{-| 'CacheName' is used in 'RegexpFilter' for describing the
    'CacheKey' keyed caching behavior.
-}
newtype CacheName =
  CacheName Text
  deriving (CacheName -> CacheName -> Bool
(CacheName -> CacheName -> Bool)
-> (CacheName -> CacheName -> Bool) -> Eq CacheName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheName -> CacheName -> Bool
$c/= :: CacheName -> CacheName -> Bool
== :: CacheName -> CacheName -> Bool
$c== :: CacheName -> CacheName -> Bool
Eq, Int -> CacheName -> ShowS
[CacheName] -> ShowS
CacheName -> String
(Int -> CacheName -> ShowS)
-> (CacheName -> String)
-> ([CacheName] -> ShowS)
-> Show CacheName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheName] -> ShowS
$cshowList :: [CacheName] -> ShowS
show :: CacheName -> String
$cshow :: CacheName -> String
showsPrec :: Int -> CacheName -> ShowS
$cshowsPrec :: Int -> CacheName -> ShowS
Show, Value -> Parser [CacheName]
Value -> Parser CacheName
(Value -> Parser CacheName)
-> (Value -> Parser [CacheName]) -> FromJSON CacheName
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [CacheName]
$cparseJSONList :: Value -> Parser [CacheName]
parseJSON :: Value -> Parser CacheName
$cparseJSON :: Value -> Parser CacheName
FromJSON, [CacheName] -> Encoding
[CacheName] -> Value
CacheName -> Encoding
CacheName -> Value
(CacheName -> Value)
-> (CacheName -> Encoding)
-> ([CacheName] -> Value)
-> ([CacheName] -> Encoding)
-> ToJSON CacheName
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CacheName] -> Encoding
$ctoEncodingList :: [CacheName] -> Encoding
toJSONList :: [CacheName] -> Value
$ctoJSONList :: [CacheName] -> Value
toEncoding :: CacheName -> Encoding
$ctoEncoding :: CacheName -> Encoding
toJSON :: CacheName -> Value
$ctoJSON :: CacheName -> Value
ToJSON)

{-| 'CacheKey' is used in 'RegexpFilter' to key regex caching.
-}
newtype CacheKey =
  CacheKey Text deriving (CacheKey -> CacheKey -> Bool
(CacheKey -> CacheKey -> Bool)
-> (CacheKey -> CacheKey -> Bool) -> Eq CacheKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheKey -> CacheKey -> Bool
$c/= :: CacheKey -> CacheKey -> Bool
== :: CacheKey -> CacheKey -> Bool
$c== :: CacheKey -> CacheKey -> Bool
Eq, Int -> CacheKey -> ShowS
[CacheKey] -> ShowS
CacheKey -> String
(Int -> CacheKey -> ShowS)
-> (CacheKey -> String) -> ([CacheKey] -> ShowS) -> Show CacheKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheKey] -> ShowS
$cshowList :: [CacheKey] -> ShowS
show :: CacheKey -> String
$cshow :: CacheKey -> String
showsPrec :: Int -> CacheKey -> ShowS
$cshowsPrec :: Int -> CacheKey -> ShowS
Show, Value -> Parser [CacheKey]
Value -> Parser CacheKey
(Value -> Parser CacheKey)
-> (Value -> Parser [CacheKey]) -> FromJSON CacheKey
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [CacheKey]
$cparseJSONList :: Value -> Parser [CacheKey]
parseJSON :: Value -> Parser CacheKey
$cparseJSON :: Value -> Parser CacheKey
FromJSON, [CacheKey] -> Encoding
[CacheKey] -> Value
CacheKey -> Encoding
CacheKey -> Value
(CacheKey -> Value)
-> (CacheKey -> Encoding)
-> ([CacheKey] -> Value)
-> ([CacheKey] -> Encoding)
-> ToJSON CacheKey
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CacheKey] -> Encoding
$ctoEncodingList :: [CacheKey] -> Encoding
toJSONList :: [CacheKey] -> Value
$ctoJSONList :: [CacheKey] -> Value
toEncoding :: CacheKey -> Encoding
$ctoEncoding :: CacheKey -> Encoding
toJSON :: CacheKey -> Value
$ctoJSON :: CacheKey -> Value
ToJSON)
newtype Existence =
  Existence Bool deriving (Existence -> Existence -> Bool
(Existence -> Existence -> Bool)
-> (Existence -> Existence -> Bool) -> Eq Existence
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Existence -> Existence -> Bool
$c/= :: Existence -> Existence -> Bool
== :: Existence -> Existence -> Bool
$c== :: Existence -> Existence -> Bool
Eq, Int -> Existence -> ShowS
[Existence] -> ShowS
Existence -> String
(Int -> Existence -> ShowS)
-> (Existence -> String)
-> ([Existence] -> ShowS)
-> Show Existence
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Existence] -> ShowS
$cshowList :: [Existence] -> ShowS
show :: Existence -> String
$cshow :: Existence -> String
showsPrec :: Int -> Existence -> ShowS
$cshowsPrec :: Int -> Existence -> ShowS
Show, Value -> Parser [Existence]
Value -> Parser Existence
(Value -> Parser Existence)
-> (Value -> Parser [Existence]) -> FromJSON Existence
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Existence]
$cparseJSONList :: Value -> Parser [Existence]
parseJSON :: Value -> Parser Existence
$cparseJSON :: Value -> Parser Existence
FromJSON, [Existence] -> Encoding
[Existence] -> Value
Existence -> Encoding
Existence -> Value
(Existence -> Value)
-> (Existence -> Encoding)
-> ([Existence] -> Value)
-> ([Existence] -> Encoding)
-> ToJSON Existence
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Existence] -> Encoding
$ctoEncodingList :: [Existence] -> Encoding
toJSONList :: [Existence] -> Value
$ctoJSONList :: [Existence] -> Value
toEncoding :: Existence -> Encoding
$ctoEncoding :: Existence -> Encoding
toJSON :: Existence -> Value
$ctoJSON :: Existence -> Value
ToJSON)
newtype NullValue =
  NullValue Bool deriving (NullValue -> NullValue -> Bool
(NullValue -> NullValue -> Bool)
-> (NullValue -> NullValue -> Bool) -> Eq NullValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NullValue -> NullValue -> Bool
$c/= :: NullValue -> NullValue -> Bool
== :: NullValue -> NullValue -> Bool
$c== :: NullValue -> NullValue -> Bool
Eq, Int -> NullValue -> ShowS
[NullValue] -> ShowS
NullValue -> String
(Int -> NullValue -> ShowS)
-> (NullValue -> String)
-> ([NullValue] -> ShowS)
-> Show NullValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NullValue] -> ShowS
$cshowList :: [NullValue] -> ShowS
show :: NullValue -> String
$cshow :: NullValue -> String
showsPrec :: Int -> NullValue -> ShowS
$cshowsPrec :: Int -> NullValue -> ShowS
Show, Value -> Parser [NullValue]
Value -> Parser NullValue
(Value -> Parser NullValue)
-> (Value -> Parser [NullValue]) -> FromJSON NullValue
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [NullValue]
$cparseJSONList :: Value -> Parser [NullValue]
parseJSON :: Value -> Parser NullValue
$cparseJSON :: Value -> Parser NullValue
FromJSON, [NullValue] -> Encoding
[NullValue] -> Value
NullValue -> Encoding
NullValue -> Value
(NullValue -> Value)
-> (NullValue -> Encoding)
-> ([NullValue] -> Value)
-> ([NullValue] -> Encoding)
-> ToJSON NullValue
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [NullValue] -> Encoding
$ctoEncodingList :: [NullValue] -> Encoding
toJSONList :: [NullValue] -> Value
$ctoJSONList :: [NullValue] -> Value
toEncoding :: NullValue -> Encoding
$ctoEncoding :: NullValue -> Encoding
toJSON :: NullValue -> Value
$ctoJSON :: NullValue -> Value
ToJSON)
newtype CutoffFrequency =
  CutoffFrequency Double deriving (CutoffFrequency -> CutoffFrequency -> Bool
(CutoffFrequency -> CutoffFrequency -> Bool)
-> (CutoffFrequency -> CutoffFrequency -> Bool)
-> Eq CutoffFrequency
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CutoffFrequency -> CutoffFrequency -> Bool
$c/= :: CutoffFrequency -> CutoffFrequency -> Bool
== :: CutoffFrequency -> CutoffFrequency -> Bool
$c== :: CutoffFrequency -> CutoffFrequency -> Bool
Eq, Int -> CutoffFrequency -> ShowS
[CutoffFrequency] -> ShowS
CutoffFrequency -> String
(Int -> CutoffFrequency -> ShowS)
-> (CutoffFrequency -> String)
-> ([CutoffFrequency] -> ShowS)
-> Show CutoffFrequency
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CutoffFrequency] -> ShowS
$cshowList :: [CutoffFrequency] -> ShowS
show :: CutoffFrequency -> String
$cshow :: CutoffFrequency -> String
showsPrec :: Int -> CutoffFrequency -> ShowS
$cshowsPrec :: Int -> CutoffFrequency -> ShowS
Show, Value -> Parser [CutoffFrequency]
Value -> Parser CutoffFrequency
(Value -> Parser CutoffFrequency)
-> (Value -> Parser [CutoffFrequency]) -> FromJSON CutoffFrequency
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [CutoffFrequency]
$cparseJSONList :: Value -> Parser [CutoffFrequency]
parseJSON :: Value -> Parser CutoffFrequency
$cparseJSON :: Value -> Parser CutoffFrequency
FromJSON, [CutoffFrequency] -> Encoding
[CutoffFrequency] -> Value
CutoffFrequency -> Encoding
CutoffFrequency -> Value
(CutoffFrequency -> Value)
-> (CutoffFrequency -> Encoding)
-> ([CutoffFrequency] -> Value)
-> ([CutoffFrequency] -> Encoding)
-> ToJSON CutoffFrequency
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CutoffFrequency] -> Encoding
$ctoEncodingList :: [CutoffFrequency] -> Encoding
toJSONList :: [CutoffFrequency] -> Value
$ctoJSONList :: [CutoffFrequency] -> Value
toEncoding :: CutoffFrequency -> Encoding
$ctoEncoding :: CutoffFrequency -> Encoding
toJSON :: CutoffFrequency -> Value
$ctoJSON :: CutoffFrequency -> Value
ToJSON)
newtype Analyzer =
  Analyzer Text deriving (Analyzer -> Analyzer -> Bool
(Analyzer -> Analyzer -> Bool)
-> (Analyzer -> Analyzer -> Bool) -> Eq Analyzer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Analyzer -> Analyzer -> Bool
$c/= :: Analyzer -> Analyzer -> Bool
== :: Analyzer -> Analyzer -> Bool
$c== :: Analyzer -> Analyzer -> Bool
Eq, Int -> Analyzer -> ShowS
[Analyzer] -> ShowS
Analyzer -> String
(Int -> Analyzer -> ShowS)
-> (Analyzer -> String) -> ([Analyzer] -> ShowS) -> Show Analyzer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Analyzer] -> ShowS
$cshowList :: [Analyzer] -> ShowS
show :: Analyzer -> String
$cshow :: Analyzer -> String
showsPrec :: Int -> Analyzer -> ShowS
$cshowsPrec :: Int -> Analyzer -> ShowS
Show, Value -> Parser [Analyzer]
Value -> Parser Analyzer
(Value -> Parser Analyzer)
-> (Value -> Parser [Analyzer]) -> FromJSON Analyzer
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Analyzer]
$cparseJSONList :: Value -> Parser [Analyzer]
parseJSON :: Value -> Parser Analyzer
$cparseJSON :: Value -> Parser Analyzer
FromJSON, [Analyzer] -> Encoding
[Analyzer] -> Value
Analyzer -> Encoding
Analyzer -> Value
(Analyzer -> Value)
-> (Analyzer -> Encoding)
-> ([Analyzer] -> Value)
-> ([Analyzer] -> Encoding)
-> ToJSON Analyzer
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Analyzer] -> Encoding
$ctoEncodingList :: [Analyzer] -> Encoding
toJSONList :: [Analyzer] -> Value
$ctoJSONList :: [Analyzer] -> Value
toEncoding :: Analyzer -> Encoding
$ctoEncoding :: Analyzer -> Encoding
toJSON :: Analyzer -> Value
$ctoJSON :: Analyzer -> Value
ToJSON)
newtype MaxExpansions =
  MaxExpansions Int deriving (MaxExpansions -> MaxExpansions -> Bool
(MaxExpansions -> MaxExpansions -> Bool)
-> (MaxExpansions -> MaxExpansions -> Bool) -> Eq MaxExpansions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaxExpansions -> MaxExpansions -> Bool
$c/= :: MaxExpansions -> MaxExpansions -> Bool
== :: MaxExpansions -> MaxExpansions -> Bool
$c== :: MaxExpansions -> MaxExpansions -> Bool
Eq, Int -> MaxExpansions -> ShowS
[MaxExpansions] -> ShowS
MaxExpansions -> String
(Int -> MaxExpansions -> ShowS)
-> (MaxExpansions -> String)
-> ([MaxExpansions] -> ShowS)
-> Show MaxExpansions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaxExpansions] -> ShowS
$cshowList :: [MaxExpansions] -> ShowS
show :: MaxExpansions -> String
$cshow :: MaxExpansions -> String
showsPrec :: Int -> MaxExpansions -> ShowS
$cshowsPrec :: Int -> MaxExpansions -> ShowS
Show, Value -> Parser [MaxExpansions]
Value -> Parser MaxExpansions
(Value -> Parser MaxExpansions)
-> (Value -> Parser [MaxExpansions]) -> FromJSON MaxExpansions
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MaxExpansions]
$cparseJSONList :: Value -> Parser [MaxExpansions]
parseJSON :: Value -> Parser MaxExpansions
$cparseJSON :: Value -> Parser MaxExpansions
FromJSON, [MaxExpansions] -> Encoding
[MaxExpansions] -> Value
MaxExpansions -> Encoding
MaxExpansions -> Value
(MaxExpansions -> Value)
-> (MaxExpansions -> Encoding)
-> ([MaxExpansions] -> Value)
-> ([MaxExpansions] -> Encoding)
-> ToJSON MaxExpansions
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MaxExpansions] -> Encoding
$ctoEncodingList :: [MaxExpansions] -> Encoding
toJSONList :: [MaxExpansions] -> Value
$ctoJSONList :: [MaxExpansions] -> Value
toEncoding :: MaxExpansions -> Encoding
$ctoEncoding :: MaxExpansions -> Encoding
toJSON :: MaxExpansions -> Value
$ctoJSON :: MaxExpansions -> Value
ToJSON)

{-| 'Lenient', if set to true, will cause format based failures to be
    ignored. I don't know what the bloody default is, Elasticsearch
    documentation didn't say what it was. Let me know if you figure it out.
-}
newtype Lenient =
  Lenient Bool deriving (Lenient -> Lenient -> Bool
(Lenient -> Lenient -> Bool)
-> (Lenient -> Lenient -> Bool) -> Eq Lenient
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Lenient -> Lenient -> Bool
$c/= :: Lenient -> Lenient -> Bool
== :: Lenient -> Lenient -> Bool
$c== :: Lenient -> Lenient -> Bool
Eq, Int -> Lenient -> ShowS
[Lenient] -> ShowS
Lenient -> String
(Int -> Lenient -> ShowS)
-> (Lenient -> String) -> ([Lenient] -> ShowS) -> Show Lenient
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Lenient] -> ShowS
$cshowList :: [Lenient] -> ShowS
show :: Lenient -> String
$cshow :: Lenient -> String
showsPrec :: Int -> Lenient -> ShowS
$cshowsPrec :: Int -> Lenient -> ShowS
Show, Value -> Parser [Lenient]
Value -> Parser Lenient
(Value -> Parser Lenient)
-> (Value -> Parser [Lenient]) -> FromJSON Lenient
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Lenient]
$cparseJSONList :: Value -> Parser [Lenient]
parseJSON :: Value -> Parser Lenient
$cparseJSON :: Value -> Parser Lenient
FromJSON, [Lenient] -> Encoding
[Lenient] -> Value
Lenient -> Encoding
Lenient -> Value
(Lenient -> Value)
-> (Lenient -> Encoding)
-> ([Lenient] -> Value)
-> ([Lenient] -> Encoding)
-> ToJSON Lenient
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Lenient] -> Encoding
$ctoEncodingList :: [Lenient] -> Encoding
toJSONList :: [Lenient] -> Value
$ctoJSONList :: [Lenient] -> Value
toEncoding :: Lenient -> Encoding
$ctoEncoding :: Lenient -> Encoding
toJSON :: Lenient -> Value
$ctoJSON :: Lenient -> Value
ToJSON)
newtype Tiebreaker =
  Tiebreaker Double deriving (Tiebreaker -> Tiebreaker -> Bool
(Tiebreaker -> Tiebreaker -> Bool)
-> (Tiebreaker -> Tiebreaker -> Bool) -> Eq Tiebreaker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tiebreaker -> Tiebreaker -> Bool
$c/= :: Tiebreaker -> Tiebreaker -> Bool
== :: Tiebreaker -> Tiebreaker -> Bool
$c== :: Tiebreaker -> Tiebreaker -> Bool
Eq, Int -> Tiebreaker -> ShowS
[Tiebreaker] -> ShowS
Tiebreaker -> String
(Int -> Tiebreaker -> ShowS)
-> (Tiebreaker -> String)
-> ([Tiebreaker] -> ShowS)
-> Show Tiebreaker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Tiebreaker] -> ShowS
$cshowList :: [Tiebreaker] -> ShowS
show :: Tiebreaker -> String
$cshow :: Tiebreaker -> String
showsPrec :: Int -> Tiebreaker -> ShowS
$cshowsPrec :: Int -> Tiebreaker -> ShowS
Show, Value -> Parser [Tiebreaker]
Value -> Parser Tiebreaker
(Value -> Parser Tiebreaker)
-> (Value -> Parser [Tiebreaker]) -> FromJSON Tiebreaker
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Tiebreaker]
$cparseJSONList :: Value -> Parser [Tiebreaker]
parseJSON :: Value -> Parser Tiebreaker
$cparseJSON :: Value -> Parser Tiebreaker
FromJSON, [Tiebreaker] -> Encoding
[Tiebreaker] -> Value
Tiebreaker -> Encoding
Tiebreaker -> Value
(Tiebreaker -> Value)
-> (Tiebreaker -> Encoding)
-> ([Tiebreaker] -> Value)
-> ([Tiebreaker] -> Encoding)
-> ToJSON Tiebreaker
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Tiebreaker] -> Encoding
$ctoEncodingList :: [Tiebreaker] -> Encoding
toJSONList :: [Tiebreaker] -> Value
$ctoJSONList :: [Tiebreaker] -> Value
toEncoding :: Tiebreaker -> Encoding
$ctoEncoding :: Tiebreaker -> Encoding
toJSON :: Tiebreaker -> Value
$ctoJSON :: Tiebreaker -> Value
ToJSON)

{-| 'MinimumMatch' controls how many should clauses in the bool query should
     match. Can be an absolute value (2) or a percentage (30%) or a
     combination of both.
-}
newtype MinimumMatch =
  MinimumMatch Int deriving (MinimumMatch -> MinimumMatch -> Bool
(MinimumMatch -> MinimumMatch -> Bool)
-> (MinimumMatch -> MinimumMatch -> Bool) -> Eq MinimumMatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MinimumMatch -> MinimumMatch -> Bool
$c/= :: MinimumMatch -> MinimumMatch -> Bool
== :: MinimumMatch -> MinimumMatch -> Bool
$c== :: MinimumMatch -> MinimumMatch -> Bool
Eq, Int -> MinimumMatch -> ShowS
[MinimumMatch] -> ShowS
MinimumMatch -> String
(Int -> MinimumMatch -> ShowS)
-> (MinimumMatch -> String)
-> ([MinimumMatch] -> ShowS)
-> Show MinimumMatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MinimumMatch] -> ShowS
$cshowList :: [MinimumMatch] -> ShowS
show :: MinimumMatch -> String
$cshow :: MinimumMatch -> String
showsPrec :: Int -> MinimumMatch -> ShowS
$cshowsPrec :: Int -> MinimumMatch -> ShowS
Show, Value -> Parser [MinimumMatch]
Value -> Parser MinimumMatch
(Value -> Parser MinimumMatch)
-> (Value -> Parser [MinimumMatch]) -> FromJSON MinimumMatch
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MinimumMatch]
$cparseJSONList :: Value -> Parser [MinimumMatch]
parseJSON :: Value -> Parser MinimumMatch
$cparseJSON :: Value -> Parser MinimumMatch
FromJSON, [MinimumMatch] -> Encoding
[MinimumMatch] -> Value
MinimumMatch -> Encoding
MinimumMatch -> Value
(MinimumMatch -> Value)
-> (MinimumMatch -> Encoding)
-> ([MinimumMatch] -> Value)
-> ([MinimumMatch] -> Encoding)
-> ToJSON MinimumMatch
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MinimumMatch] -> Encoding
$ctoEncodingList :: [MinimumMatch] -> Encoding
toJSONList :: [MinimumMatch] -> Value
$ctoJSONList :: [MinimumMatch] -> Value
toEncoding :: MinimumMatch -> Encoding
$ctoEncoding :: MinimumMatch -> Encoding
toJSON :: MinimumMatch -> Value
$ctoJSON :: MinimumMatch -> Value
ToJSON)
newtype DisableCoord =
  DisableCoord Bool deriving (DisableCoord -> DisableCoord -> Bool
(DisableCoord -> DisableCoord -> Bool)
-> (DisableCoord -> DisableCoord -> Bool) -> Eq DisableCoord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisableCoord -> DisableCoord -> Bool
$c/= :: DisableCoord -> DisableCoord -> Bool
== :: DisableCoord -> DisableCoord -> Bool
$c== :: DisableCoord -> DisableCoord -> Bool
Eq, Int -> DisableCoord -> ShowS
[DisableCoord] -> ShowS
DisableCoord -> String
(Int -> DisableCoord -> ShowS)
-> (DisableCoord -> String)
-> ([DisableCoord] -> ShowS)
-> Show DisableCoord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisableCoord] -> ShowS
$cshowList :: [DisableCoord] -> ShowS
show :: DisableCoord -> String
$cshow :: DisableCoord -> String
showsPrec :: Int -> DisableCoord -> ShowS
$cshowsPrec :: Int -> DisableCoord -> ShowS
Show, Value -> Parser [DisableCoord]
Value -> Parser DisableCoord
(Value -> Parser DisableCoord)
-> (Value -> Parser [DisableCoord]) -> FromJSON DisableCoord
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [DisableCoord]
$cparseJSONList :: Value -> Parser [DisableCoord]
parseJSON :: Value -> Parser DisableCoord
$cparseJSON :: Value -> Parser DisableCoord
FromJSON, [DisableCoord] -> Encoding
[DisableCoord] -> Value
DisableCoord -> Encoding
DisableCoord -> Value
(DisableCoord -> Value)
-> (DisableCoord -> Encoding)
-> ([DisableCoord] -> Value)
-> ([DisableCoord] -> Encoding)
-> ToJSON DisableCoord
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [DisableCoord] -> Encoding
$ctoEncodingList :: [DisableCoord] -> Encoding
toJSONList :: [DisableCoord] -> Value
$ctoJSONList :: [DisableCoord] -> Value
toEncoding :: DisableCoord -> Encoding
$ctoEncoding :: DisableCoord -> Encoding
toJSON :: DisableCoord -> Value
$ctoJSON :: DisableCoord -> Value
ToJSON)
newtype IgnoreTermFrequency =
  IgnoreTermFrequency Bool deriving (IgnoreTermFrequency -> IgnoreTermFrequency -> Bool
(IgnoreTermFrequency -> IgnoreTermFrequency -> Bool)
-> (IgnoreTermFrequency -> IgnoreTermFrequency -> Bool)
-> Eq IgnoreTermFrequency
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IgnoreTermFrequency -> IgnoreTermFrequency -> Bool
$c/= :: IgnoreTermFrequency -> IgnoreTermFrequency -> Bool
== :: IgnoreTermFrequency -> IgnoreTermFrequency -> Bool
$c== :: IgnoreTermFrequency -> IgnoreTermFrequency -> Bool
Eq, Int -> IgnoreTermFrequency -> ShowS
[IgnoreTermFrequency] -> ShowS
IgnoreTermFrequency -> String
(Int -> IgnoreTermFrequency -> ShowS)
-> (IgnoreTermFrequency -> String)
-> ([IgnoreTermFrequency] -> ShowS)
-> Show IgnoreTermFrequency
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IgnoreTermFrequency] -> ShowS
$cshowList :: [IgnoreTermFrequency] -> ShowS
show :: IgnoreTermFrequency -> String
$cshow :: IgnoreTermFrequency -> String
showsPrec :: Int -> IgnoreTermFrequency -> ShowS
$cshowsPrec :: Int -> IgnoreTermFrequency -> ShowS
Show, Value -> Parser [IgnoreTermFrequency]
Value -> Parser IgnoreTermFrequency
(Value -> Parser IgnoreTermFrequency)
-> (Value -> Parser [IgnoreTermFrequency])
-> FromJSON IgnoreTermFrequency
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [IgnoreTermFrequency]
$cparseJSONList :: Value -> Parser [IgnoreTermFrequency]
parseJSON :: Value -> Parser IgnoreTermFrequency
$cparseJSON :: Value -> Parser IgnoreTermFrequency
FromJSON, [IgnoreTermFrequency] -> Encoding
[IgnoreTermFrequency] -> Value
IgnoreTermFrequency -> Encoding
IgnoreTermFrequency -> Value
(IgnoreTermFrequency -> Value)
-> (IgnoreTermFrequency -> Encoding)
-> ([IgnoreTermFrequency] -> Value)
-> ([IgnoreTermFrequency] -> Encoding)
-> ToJSON IgnoreTermFrequency
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [IgnoreTermFrequency] -> Encoding
$ctoEncodingList :: [IgnoreTermFrequency] -> Encoding
toJSONList :: [IgnoreTermFrequency] -> Value
$ctoJSONList :: [IgnoreTermFrequency] -> Value
toEncoding :: IgnoreTermFrequency -> Encoding
$ctoEncoding :: IgnoreTermFrequency -> Encoding
toJSON :: IgnoreTermFrequency -> Value
$ctoJSON :: IgnoreTermFrequency -> Value
ToJSON)
newtype MinimumTermFrequency =
  MinimumTermFrequency Int deriving (MinimumTermFrequency -> MinimumTermFrequency -> Bool
(MinimumTermFrequency -> MinimumTermFrequency -> Bool)
-> (MinimumTermFrequency -> MinimumTermFrequency -> Bool)
-> Eq MinimumTermFrequency
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MinimumTermFrequency -> MinimumTermFrequency -> Bool
$c/= :: MinimumTermFrequency -> MinimumTermFrequency -> Bool
== :: MinimumTermFrequency -> MinimumTermFrequency -> Bool
$c== :: MinimumTermFrequency -> MinimumTermFrequency -> Bool
Eq, Int -> MinimumTermFrequency -> ShowS
[MinimumTermFrequency] -> ShowS
MinimumTermFrequency -> String
(Int -> MinimumTermFrequency -> ShowS)
-> (MinimumTermFrequency -> String)
-> ([MinimumTermFrequency] -> ShowS)
-> Show MinimumTermFrequency
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MinimumTermFrequency] -> ShowS
$cshowList :: [MinimumTermFrequency] -> ShowS
show :: MinimumTermFrequency -> String
$cshow :: MinimumTermFrequency -> String
showsPrec :: Int -> MinimumTermFrequency -> ShowS
$cshowsPrec :: Int -> MinimumTermFrequency -> ShowS
Show, Value -> Parser [MinimumTermFrequency]
Value -> Parser MinimumTermFrequency
(Value -> Parser MinimumTermFrequency)
-> (Value -> Parser [MinimumTermFrequency])
-> FromJSON MinimumTermFrequency
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MinimumTermFrequency]
$cparseJSONList :: Value -> Parser [MinimumTermFrequency]
parseJSON :: Value -> Parser MinimumTermFrequency
$cparseJSON :: Value -> Parser MinimumTermFrequency
FromJSON, [MinimumTermFrequency] -> Encoding
[MinimumTermFrequency] -> Value
MinimumTermFrequency -> Encoding
MinimumTermFrequency -> Value
(MinimumTermFrequency -> Value)
-> (MinimumTermFrequency -> Encoding)
-> ([MinimumTermFrequency] -> Value)
-> ([MinimumTermFrequency] -> Encoding)
-> ToJSON MinimumTermFrequency
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MinimumTermFrequency] -> Encoding
$ctoEncodingList :: [MinimumTermFrequency] -> Encoding
toJSONList :: [MinimumTermFrequency] -> Value
$ctoJSONList :: [MinimumTermFrequency] -> Value
toEncoding :: MinimumTermFrequency -> Encoding
$ctoEncoding :: MinimumTermFrequency -> Encoding
toJSON :: MinimumTermFrequency -> Value
$ctoJSON :: MinimumTermFrequency -> Value
ToJSON)
newtype MaxQueryTerms =
  MaxQueryTerms Int deriving (MaxQueryTerms -> MaxQueryTerms -> Bool
(MaxQueryTerms -> MaxQueryTerms -> Bool)
-> (MaxQueryTerms -> MaxQueryTerms -> Bool) -> Eq MaxQueryTerms
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaxQueryTerms -> MaxQueryTerms -> Bool
$c/= :: MaxQueryTerms -> MaxQueryTerms -> Bool
== :: MaxQueryTerms -> MaxQueryTerms -> Bool
$c== :: MaxQueryTerms -> MaxQueryTerms -> Bool
Eq, Int -> MaxQueryTerms -> ShowS
[MaxQueryTerms] -> ShowS
MaxQueryTerms -> String
(Int -> MaxQueryTerms -> ShowS)
-> (MaxQueryTerms -> String)
-> ([MaxQueryTerms] -> ShowS)
-> Show MaxQueryTerms
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaxQueryTerms] -> ShowS
$cshowList :: [MaxQueryTerms] -> ShowS
show :: MaxQueryTerms -> String
$cshow :: MaxQueryTerms -> String
showsPrec :: Int -> MaxQueryTerms -> ShowS
$cshowsPrec :: Int -> MaxQueryTerms -> ShowS
Show, Value -> Parser [MaxQueryTerms]
Value -> Parser MaxQueryTerms
(Value -> Parser MaxQueryTerms)
-> (Value -> Parser [MaxQueryTerms]) -> FromJSON MaxQueryTerms
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MaxQueryTerms]
$cparseJSONList :: Value -> Parser [MaxQueryTerms]
parseJSON :: Value -> Parser MaxQueryTerms
$cparseJSON :: Value -> Parser MaxQueryTerms
FromJSON, [MaxQueryTerms] -> Encoding
[MaxQueryTerms] -> Value
MaxQueryTerms -> Encoding
MaxQueryTerms -> Value
(MaxQueryTerms -> Value)
-> (MaxQueryTerms -> Encoding)
-> ([MaxQueryTerms] -> Value)
-> ([MaxQueryTerms] -> Encoding)
-> ToJSON MaxQueryTerms
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MaxQueryTerms] -> Encoding
$ctoEncodingList :: [MaxQueryTerms] -> Encoding
toJSONList :: [MaxQueryTerms] -> Value
$ctoJSONList :: [MaxQueryTerms] -> Value
toEncoding :: MaxQueryTerms -> Encoding
$ctoEncoding :: MaxQueryTerms -> Encoding
toJSON :: MaxQueryTerms -> Value
$ctoJSON :: MaxQueryTerms -> Value
ToJSON)

{-| 'PrefixLength' is the prefix length used in queries, defaults to 0. -}
newtype PrefixLength =
  PrefixLength Int deriving (PrefixLength -> PrefixLength -> Bool
(PrefixLength -> PrefixLength -> Bool)
-> (PrefixLength -> PrefixLength -> Bool) -> Eq PrefixLength
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PrefixLength -> PrefixLength -> Bool
$c/= :: PrefixLength -> PrefixLength -> Bool
== :: PrefixLength -> PrefixLength -> Bool
$c== :: PrefixLength -> PrefixLength -> Bool
Eq, Int -> PrefixLength -> ShowS
[PrefixLength] -> ShowS
PrefixLength -> String
(Int -> PrefixLength -> ShowS)
-> (PrefixLength -> String)
-> ([PrefixLength] -> ShowS)
-> Show PrefixLength
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrefixLength] -> ShowS
$cshowList :: [PrefixLength] -> ShowS
show :: PrefixLength -> String
$cshow :: PrefixLength -> String
showsPrec :: Int -> PrefixLength -> ShowS
$cshowsPrec :: Int -> PrefixLength -> ShowS
Show, Value -> Parser [PrefixLength]
Value -> Parser PrefixLength
(Value -> Parser PrefixLength)
-> (Value -> Parser [PrefixLength]) -> FromJSON PrefixLength
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [PrefixLength]
$cparseJSONList :: Value -> Parser [PrefixLength]
parseJSON :: Value -> Parser PrefixLength
$cparseJSON :: Value -> Parser PrefixLength
FromJSON, [PrefixLength] -> Encoding
[PrefixLength] -> Value
PrefixLength -> Encoding
PrefixLength -> Value
(PrefixLength -> Value)
-> (PrefixLength -> Encoding)
-> ([PrefixLength] -> Value)
-> ([PrefixLength] -> Encoding)
-> ToJSON PrefixLength
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [PrefixLength] -> Encoding
$ctoEncodingList :: [PrefixLength] -> Encoding
toJSONList :: [PrefixLength] -> Value
$ctoJSONList :: [PrefixLength] -> Value
toEncoding :: PrefixLength -> Encoding
$ctoEncoding :: PrefixLength -> Encoding
toJSON :: PrefixLength -> Value
$ctoJSON :: PrefixLength -> Value
ToJSON)
newtype PercentMatch =
  PercentMatch Double deriving (PercentMatch -> PercentMatch -> Bool
(PercentMatch -> PercentMatch -> Bool)
-> (PercentMatch -> PercentMatch -> Bool) -> Eq PercentMatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PercentMatch -> PercentMatch -> Bool
$c/= :: PercentMatch -> PercentMatch -> Bool
== :: PercentMatch -> PercentMatch -> Bool
$c== :: PercentMatch -> PercentMatch -> Bool
Eq, Int -> PercentMatch -> ShowS
[PercentMatch] -> ShowS
PercentMatch -> String
(Int -> PercentMatch -> ShowS)
-> (PercentMatch -> String)
-> ([PercentMatch] -> ShowS)
-> Show PercentMatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PercentMatch] -> ShowS
$cshowList :: [PercentMatch] -> ShowS
show :: PercentMatch -> String
$cshow :: PercentMatch -> String
showsPrec :: Int -> PercentMatch -> ShowS
$cshowsPrec :: Int -> PercentMatch -> ShowS
Show, Value -> Parser [PercentMatch]
Value -> Parser PercentMatch
(Value -> Parser PercentMatch)
-> (Value -> Parser [PercentMatch]) -> FromJSON PercentMatch
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [PercentMatch]
$cparseJSONList :: Value -> Parser [PercentMatch]
parseJSON :: Value -> Parser PercentMatch
$cparseJSON :: Value -> Parser PercentMatch
FromJSON, [PercentMatch] -> Encoding
[PercentMatch] -> Value
PercentMatch -> Encoding
PercentMatch -> Value
(PercentMatch -> Value)
-> (PercentMatch -> Encoding)
-> ([PercentMatch] -> Value)
-> ([PercentMatch] -> Encoding)
-> ToJSON PercentMatch
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [PercentMatch] -> Encoding
$ctoEncodingList :: [PercentMatch] -> Encoding
toJSONList :: [PercentMatch] -> Value
$ctoJSONList :: [PercentMatch] -> Value
toEncoding :: PercentMatch -> Encoding
$ctoEncoding :: PercentMatch -> Encoding
toJSON :: PercentMatch -> Value
$ctoJSON :: PercentMatch -> Value
ToJSON)
newtype StopWord =
  StopWord Text deriving (StopWord -> StopWord -> Bool
(StopWord -> StopWord -> Bool)
-> (StopWord -> StopWord -> Bool) -> Eq StopWord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopWord -> StopWord -> Bool
$c/= :: StopWord -> StopWord -> Bool
== :: StopWord -> StopWord -> Bool
$c== :: StopWord -> StopWord -> Bool
Eq, Int -> StopWord -> ShowS
[StopWord] -> ShowS
StopWord -> String
(Int -> StopWord -> ShowS)
-> (StopWord -> String) -> ([StopWord] -> ShowS) -> Show StopWord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopWord] -> ShowS
$cshowList :: [StopWord] -> ShowS
show :: StopWord -> String
$cshow :: StopWord -> String
showsPrec :: Int -> StopWord -> ShowS
$cshowsPrec :: Int -> StopWord -> ShowS
Show, Value -> Parser [StopWord]
Value -> Parser StopWord
(Value -> Parser StopWord)
-> (Value -> Parser [StopWord]) -> FromJSON StopWord
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [StopWord]
$cparseJSONList :: Value -> Parser [StopWord]
parseJSON :: Value -> Parser StopWord
$cparseJSON :: Value -> Parser StopWord
FromJSON, [StopWord] -> Encoding
[StopWord] -> Value
StopWord -> Encoding
StopWord -> Value
(StopWord -> Value)
-> (StopWord -> Encoding)
-> ([StopWord] -> Value)
-> ([StopWord] -> Encoding)
-> ToJSON StopWord
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [StopWord] -> Encoding
$ctoEncodingList :: [StopWord] -> Encoding
toJSONList :: [StopWord] -> Value
$ctoJSONList :: [StopWord] -> Value
toEncoding :: StopWord -> Encoding
$ctoEncoding :: StopWord -> Encoding
toJSON :: StopWord -> Value
$ctoJSON :: StopWord -> Value
ToJSON)
newtype QueryPath =
  QueryPath Text deriving (QueryPath -> QueryPath -> Bool
(QueryPath -> QueryPath -> Bool)
-> (QueryPath -> QueryPath -> Bool) -> Eq QueryPath
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueryPath -> QueryPath -> Bool
$c/= :: QueryPath -> QueryPath -> Bool
== :: QueryPath -> QueryPath -> Bool
$c== :: QueryPath -> QueryPath -> Bool
Eq, Int -> QueryPath -> ShowS
[QueryPath] -> ShowS
QueryPath -> String
(Int -> QueryPath -> ShowS)
-> (QueryPath -> String)
-> ([QueryPath] -> ShowS)
-> Show QueryPath
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueryPath] -> ShowS
$cshowList :: [QueryPath] -> ShowS
show :: QueryPath -> String
$cshow :: QueryPath -> String
showsPrec :: Int -> QueryPath -> ShowS
$cshowsPrec :: Int -> QueryPath -> ShowS
Show, Value -> Parser [QueryPath]
Value -> Parser QueryPath
(Value -> Parser QueryPath)
-> (Value -> Parser [QueryPath]) -> FromJSON QueryPath
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [QueryPath]
$cparseJSONList :: Value -> Parser [QueryPath]
parseJSON :: Value -> Parser QueryPath
$cparseJSON :: Value -> Parser QueryPath
FromJSON, [QueryPath] -> Encoding
[QueryPath] -> Value
QueryPath -> Encoding
QueryPath -> Value
(QueryPath -> Value)
-> (QueryPath -> Encoding)
-> ([QueryPath] -> Value)
-> ([QueryPath] -> Encoding)
-> ToJSON QueryPath
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [QueryPath] -> Encoding
$ctoEncodingList :: [QueryPath] -> Encoding
toJSONList :: [QueryPath] -> Value
$ctoJSONList :: [QueryPath] -> Value
toEncoding :: QueryPath -> Encoding
$ctoEncoding :: QueryPath -> Encoding
toJSON :: QueryPath -> Value
$ctoJSON :: QueryPath -> Value
ToJSON)

{-| Allowing a wildcard at the beginning of a word (eg "*ing") is particularly
    heavy, because all terms in the index need to be examined, just in case
    they match. Leading wildcards can be disabled by setting
    'AllowLeadingWildcard' to false. -}
newtype AllowLeadingWildcard =
  AllowLeadingWildcard     Bool deriving (AllowLeadingWildcard -> AllowLeadingWildcard -> Bool
(AllowLeadingWildcard -> AllowLeadingWildcard -> Bool)
-> (AllowLeadingWildcard -> AllowLeadingWildcard -> Bool)
-> Eq AllowLeadingWildcard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AllowLeadingWildcard -> AllowLeadingWildcard -> Bool
$c/= :: AllowLeadingWildcard -> AllowLeadingWildcard -> Bool
== :: AllowLeadingWildcard -> AllowLeadingWildcard -> Bool
$c== :: AllowLeadingWildcard -> AllowLeadingWildcard -> Bool
Eq, Int -> AllowLeadingWildcard -> ShowS
[AllowLeadingWildcard] -> ShowS
AllowLeadingWildcard -> String
(Int -> AllowLeadingWildcard -> ShowS)
-> (AllowLeadingWildcard -> String)
-> ([AllowLeadingWildcard] -> ShowS)
-> Show AllowLeadingWildcard
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AllowLeadingWildcard] -> ShowS
$cshowList :: [AllowLeadingWildcard] -> ShowS
show :: AllowLeadingWildcard -> String
$cshow :: AllowLeadingWildcard -> String
showsPrec :: Int -> AllowLeadingWildcard -> ShowS
$cshowsPrec :: Int -> AllowLeadingWildcard -> ShowS
Show, Value -> Parser [AllowLeadingWildcard]
Value -> Parser AllowLeadingWildcard
(Value -> Parser AllowLeadingWildcard)
-> (Value -> Parser [AllowLeadingWildcard])
-> FromJSON AllowLeadingWildcard
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AllowLeadingWildcard]
$cparseJSONList :: Value -> Parser [AllowLeadingWildcard]
parseJSON :: Value -> Parser AllowLeadingWildcard
$cparseJSON :: Value -> Parser AllowLeadingWildcard
FromJSON, [AllowLeadingWildcard] -> Encoding
[AllowLeadingWildcard] -> Value
AllowLeadingWildcard -> Encoding
AllowLeadingWildcard -> Value
(AllowLeadingWildcard -> Value)
-> (AllowLeadingWildcard -> Encoding)
-> ([AllowLeadingWildcard] -> Value)
-> ([AllowLeadingWildcard] -> Encoding)
-> ToJSON AllowLeadingWildcard
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AllowLeadingWildcard] -> Encoding
$ctoEncodingList :: [AllowLeadingWildcard] -> Encoding
toJSONList :: [AllowLeadingWildcard] -> Value
$ctoJSONList :: [AllowLeadingWildcard] -> Value
toEncoding :: AllowLeadingWildcard -> Encoding
$ctoEncoding :: AllowLeadingWildcard -> Encoding
toJSON :: AllowLeadingWildcard -> Value
$ctoJSON :: AllowLeadingWildcard -> Value
ToJSON)
newtype LowercaseExpanded =
  LowercaseExpanded        Bool deriving (LowercaseExpanded -> LowercaseExpanded -> Bool
(LowercaseExpanded -> LowercaseExpanded -> Bool)
-> (LowercaseExpanded -> LowercaseExpanded -> Bool)
-> Eq LowercaseExpanded
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LowercaseExpanded -> LowercaseExpanded -> Bool
$c/= :: LowercaseExpanded -> LowercaseExpanded -> Bool
== :: LowercaseExpanded -> LowercaseExpanded -> Bool
$c== :: LowercaseExpanded -> LowercaseExpanded -> Bool
Eq, Int -> LowercaseExpanded -> ShowS
[LowercaseExpanded] -> ShowS
LowercaseExpanded -> String
(Int -> LowercaseExpanded -> ShowS)
-> (LowercaseExpanded -> String)
-> ([LowercaseExpanded] -> ShowS)
-> Show LowercaseExpanded
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LowercaseExpanded] -> ShowS
$cshowList :: [LowercaseExpanded] -> ShowS
show :: LowercaseExpanded -> String
$cshow :: LowercaseExpanded -> String
showsPrec :: Int -> LowercaseExpanded -> ShowS
$cshowsPrec :: Int -> LowercaseExpanded -> ShowS
Show, Value -> Parser [LowercaseExpanded]
Value -> Parser LowercaseExpanded
(Value -> Parser LowercaseExpanded)
-> (Value -> Parser [LowercaseExpanded])
-> FromJSON LowercaseExpanded
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [LowercaseExpanded]
$cparseJSONList :: Value -> Parser [LowercaseExpanded]
parseJSON :: Value -> Parser LowercaseExpanded
$cparseJSON :: Value -> Parser LowercaseExpanded
FromJSON, [LowercaseExpanded] -> Encoding
[LowercaseExpanded] -> Value
LowercaseExpanded -> Encoding
LowercaseExpanded -> Value
(LowercaseExpanded -> Value)
-> (LowercaseExpanded -> Encoding)
-> ([LowercaseExpanded] -> Value)
-> ([LowercaseExpanded] -> Encoding)
-> ToJSON LowercaseExpanded
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [LowercaseExpanded] -> Encoding
$ctoEncodingList :: [LowercaseExpanded] -> Encoding
toJSONList :: [LowercaseExpanded] -> Value
$ctoJSONList :: [LowercaseExpanded] -> Value
toEncoding :: LowercaseExpanded -> Encoding
$ctoEncoding :: LowercaseExpanded -> Encoding
toJSON :: LowercaseExpanded -> Value
$ctoJSON :: LowercaseExpanded -> Value
ToJSON)
newtype EnablePositionIncrements =
  EnablePositionIncrements Bool deriving (EnablePositionIncrements -> EnablePositionIncrements -> Bool
(EnablePositionIncrements -> EnablePositionIncrements -> Bool)
-> (EnablePositionIncrements -> EnablePositionIncrements -> Bool)
-> Eq EnablePositionIncrements
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnablePositionIncrements -> EnablePositionIncrements -> Bool
$c/= :: EnablePositionIncrements -> EnablePositionIncrements -> Bool
== :: EnablePositionIncrements -> EnablePositionIncrements -> Bool
$c== :: EnablePositionIncrements -> EnablePositionIncrements -> Bool
Eq, Int -> EnablePositionIncrements -> ShowS
[EnablePositionIncrements] -> ShowS
EnablePositionIncrements -> String
(Int -> EnablePositionIncrements -> ShowS)
-> (EnablePositionIncrements -> String)
-> ([EnablePositionIncrements] -> ShowS)
-> Show EnablePositionIncrements
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnablePositionIncrements] -> ShowS
$cshowList :: [EnablePositionIncrements] -> ShowS
show :: EnablePositionIncrements -> String
$cshow :: EnablePositionIncrements -> String
showsPrec :: Int -> EnablePositionIncrements -> ShowS
$cshowsPrec :: Int -> EnablePositionIncrements -> ShowS
Show, Value -> Parser [EnablePositionIncrements]
Value -> Parser EnablePositionIncrements
(Value -> Parser EnablePositionIncrements)
-> (Value -> Parser [EnablePositionIncrements])
-> FromJSON EnablePositionIncrements
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EnablePositionIncrements]
$cparseJSONList :: Value -> Parser [EnablePositionIncrements]
parseJSON :: Value -> Parser EnablePositionIncrements
$cparseJSON :: Value -> Parser EnablePositionIncrements
FromJSON, [EnablePositionIncrements] -> Encoding
[EnablePositionIncrements] -> Value
EnablePositionIncrements -> Encoding
EnablePositionIncrements -> Value
(EnablePositionIncrements -> Value)
-> (EnablePositionIncrements -> Encoding)
-> ([EnablePositionIncrements] -> Value)
-> ([EnablePositionIncrements] -> Encoding)
-> ToJSON EnablePositionIncrements
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EnablePositionIncrements] -> Encoding
$ctoEncodingList :: [EnablePositionIncrements] -> Encoding
toJSONList :: [EnablePositionIncrements] -> Value
$ctoJSONList :: [EnablePositionIncrements] -> Value
toEncoding :: EnablePositionIncrements -> Encoding
$ctoEncoding :: EnablePositionIncrements -> Encoding
toJSON :: EnablePositionIncrements -> Value
$ctoJSON :: EnablePositionIncrements -> Value
ToJSON)

{-| By default, wildcard terms in a query are not analyzed.
    Setting 'AnalyzeWildcard' to true enables best-effort analysis.
-}
newtype AnalyzeWildcard = AnalyzeWildcard Bool deriving (AnalyzeWildcard -> AnalyzeWildcard -> Bool
(AnalyzeWildcard -> AnalyzeWildcard -> Bool)
-> (AnalyzeWildcard -> AnalyzeWildcard -> Bool)
-> Eq AnalyzeWildcard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalyzeWildcard -> AnalyzeWildcard -> Bool
$c/= :: AnalyzeWildcard -> AnalyzeWildcard -> Bool
== :: AnalyzeWildcard -> AnalyzeWildcard -> Bool
$c== :: AnalyzeWildcard -> AnalyzeWildcard -> Bool
Eq, Int -> AnalyzeWildcard -> ShowS
[AnalyzeWildcard] -> ShowS
AnalyzeWildcard -> String
(Int -> AnalyzeWildcard -> ShowS)
-> (AnalyzeWildcard -> String)
-> ([AnalyzeWildcard] -> ShowS)
-> Show AnalyzeWildcard
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalyzeWildcard] -> ShowS
$cshowList :: [AnalyzeWildcard] -> ShowS
show :: AnalyzeWildcard -> String
$cshow :: AnalyzeWildcard -> String
showsPrec :: Int -> AnalyzeWildcard -> ShowS
$cshowsPrec :: Int -> AnalyzeWildcard -> ShowS
Show, Value -> Parser [AnalyzeWildcard]
Value -> Parser AnalyzeWildcard
(Value -> Parser AnalyzeWildcard)
-> (Value -> Parser [AnalyzeWildcard]) -> FromJSON AnalyzeWildcard
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AnalyzeWildcard]
$cparseJSONList :: Value -> Parser [AnalyzeWildcard]
parseJSON :: Value -> Parser AnalyzeWildcard
$cparseJSON :: Value -> Parser AnalyzeWildcard
FromJSON, [AnalyzeWildcard] -> Encoding
[AnalyzeWildcard] -> Value
AnalyzeWildcard -> Encoding
AnalyzeWildcard -> Value
(AnalyzeWildcard -> Value)
-> (AnalyzeWildcard -> Encoding)
-> ([AnalyzeWildcard] -> Value)
-> ([AnalyzeWildcard] -> Encoding)
-> ToJSON AnalyzeWildcard
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AnalyzeWildcard] -> Encoding
$ctoEncodingList :: [AnalyzeWildcard] -> Encoding
toJSONList :: [AnalyzeWildcard] -> Value
$ctoJSONList :: [AnalyzeWildcard] -> Value
toEncoding :: AnalyzeWildcard -> Encoding
$ctoEncoding :: AnalyzeWildcard -> Encoding
toJSON :: AnalyzeWildcard -> Value
$ctoJSON :: AnalyzeWildcard -> Value
ToJSON)

{-| 'GeneratePhraseQueries' defaults to false.
-}
newtype GeneratePhraseQueries =
  GeneratePhraseQueries Bool deriving (GeneratePhraseQueries -> GeneratePhraseQueries -> Bool
(GeneratePhraseQueries -> GeneratePhraseQueries -> Bool)
-> (GeneratePhraseQueries -> GeneratePhraseQueries -> Bool)
-> Eq GeneratePhraseQueries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeneratePhraseQueries -> GeneratePhraseQueries -> Bool
$c/= :: GeneratePhraseQueries -> GeneratePhraseQueries -> Bool
== :: GeneratePhraseQueries -> GeneratePhraseQueries -> Bool
$c== :: GeneratePhraseQueries -> GeneratePhraseQueries -> Bool
Eq, Int -> GeneratePhraseQueries -> ShowS
[GeneratePhraseQueries] -> ShowS
GeneratePhraseQueries -> String
(Int -> GeneratePhraseQueries -> ShowS)
-> (GeneratePhraseQueries -> String)
-> ([GeneratePhraseQueries] -> ShowS)
-> Show GeneratePhraseQueries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeneratePhraseQueries] -> ShowS
$cshowList :: [GeneratePhraseQueries] -> ShowS
show :: GeneratePhraseQueries -> String
$cshow :: GeneratePhraseQueries -> String
showsPrec :: Int -> GeneratePhraseQueries -> ShowS
$cshowsPrec :: Int -> GeneratePhraseQueries -> ShowS
Show, Value -> Parser [GeneratePhraseQueries]
Value -> Parser GeneratePhraseQueries
(Value -> Parser GeneratePhraseQueries)
-> (Value -> Parser [GeneratePhraseQueries])
-> FromJSON GeneratePhraseQueries
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [GeneratePhraseQueries]
$cparseJSONList :: Value -> Parser [GeneratePhraseQueries]
parseJSON :: Value -> Parser GeneratePhraseQueries
$cparseJSON :: Value -> Parser GeneratePhraseQueries
FromJSON, [GeneratePhraseQueries] -> Encoding
[GeneratePhraseQueries] -> Value
GeneratePhraseQueries -> Encoding
GeneratePhraseQueries -> Value
(GeneratePhraseQueries -> Value)
-> (GeneratePhraseQueries -> Encoding)
-> ([GeneratePhraseQueries] -> Value)
-> ([GeneratePhraseQueries] -> Encoding)
-> ToJSON GeneratePhraseQueries
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [GeneratePhraseQueries] -> Encoding
$ctoEncodingList :: [GeneratePhraseQueries] -> Encoding
toJSONList :: [GeneratePhraseQueries] -> Value
$ctoJSONList :: [GeneratePhraseQueries] -> Value
toEncoding :: GeneratePhraseQueries -> Encoding
$ctoEncoding :: GeneratePhraseQueries -> Encoding
toJSON :: GeneratePhraseQueries -> Value
$ctoJSON :: GeneratePhraseQueries -> Value
ToJSON)

{-| 'Locale' is used for string conversions - defaults to ROOT.
-}
newtype Locale        = Locale        Text deriving (Locale -> Locale -> Bool
(Locale -> Locale -> Bool)
-> (Locale -> Locale -> Bool) -> Eq Locale
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Locale -> Locale -> Bool
$c/= :: Locale -> Locale -> Bool
== :: Locale -> Locale -> Bool
$c== :: Locale -> Locale -> Bool
Eq, Int -> Locale -> ShowS
[Locale] -> ShowS
Locale -> String
(Int -> Locale -> ShowS)
-> (Locale -> String) -> ([Locale] -> ShowS) -> Show Locale
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Locale] -> ShowS
$cshowList :: [Locale] -> ShowS
show :: Locale -> String
$cshow :: Locale -> String
showsPrec :: Int -> Locale -> ShowS
$cshowsPrec :: Int -> Locale -> ShowS
Show, Value -> Parser [Locale]
Value -> Parser Locale
(Value -> Parser Locale)
-> (Value -> Parser [Locale]) -> FromJSON Locale
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Locale]
$cparseJSONList :: Value -> Parser [Locale]
parseJSON :: Value -> Parser Locale
$cparseJSON :: Value -> Parser Locale
FromJSON, [Locale] -> Encoding
[Locale] -> Value
Locale -> Encoding
Locale -> Value
(Locale -> Value)
-> (Locale -> Encoding)
-> ([Locale] -> Value)
-> ([Locale] -> Encoding)
-> ToJSON Locale
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Locale] -> Encoding
$ctoEncodingList :: [Locale] -> Encoding
toJSONList :: [Locale] -> Value
$ctoJSONList :: [Locale] -> Value
toEncoding :: Locale -> Encoding
$ctoEncoding :: Locale -> Encoding
toJSON :: Locale -> Value
$ctoJSON :: Locale -> Value
ToJSON)
newtype MaxWordLength = MaxWordLength Int  deriving (MaxWordLength -> MaxWordLength -> Bool
(MaxWordLength -> MaxWordLength -> Bool)
-> (MaxWordLength -> MaxWordLength -> Bool) -> Eq MaxWordLength
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaxWordLength -> MaxWordLength -> Bool
$c/= :: MaxWordLength -> MaxWordLength -> Bool
== :: MaxWordLength -> MaxWordLength -> Bool
$c== :: MaxWordLength -> MaxWordLength -> Bool
Eq, Int -> MaxWordLength -> ShowS
[MaxWordLength] -> ShowS
MaxWordLength -> String
(Int -> MaxWordLength -> ShowS)
-> (MaxWordLength -> String)
-> ([MaxWordLength] -> ShowS)
-> Show MaxWordLength
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaxWordLength] -> ShowS
$cshowList :: [MaxWordLength] -> ShowS
show :: MaxWordLength -> String
$cshow :: MaxWordLength -> String
showsPrec :: Int -> MaxWordLength -> ShowS
$cshowsPrec :: Int -> MaxWordLength -> ShowS
Show, Value -> Parser [MaxWordLength]
Value -> Parser MaxWordLength
(Value -> Parser MaxWordLength)
-> (Value -> Parser [MaxWordLength]) -> FromJSON MaxWordLength
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MaxWordLength]
$cparseJSONList :: Value -> Parser [MaxWordLength]
parseJSON :: Value -> Parser MaxWordLength
$cparseJSON :: Value -> Parser MaxWordLength
FromJSON, [MaxWordLength] -> Encoding
[MaxWordLength] -> Value
MaxWordLength -> Encoding
MaxWordLength -> Value
(MaxWordLength -> Value)
-> (MaxWordLength -> Encoding)
-> ([MaxWordLength] -> Value)
-> ([MaxWordLength] -> Encoding)
-> ToJSON MaxWordLength
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MaxWordLength] -> Encoding
$ctoEncodingList :: [MaxWordLength] -> Encoding
toJSONList :: [MaxWordLength] -> Value
$ctoJSONList :: [MaxWordLength] -> Value
toEncoding :: MaxWordLength -> Encoding
$ctoEncoding :: MaxWordLength -> Encoding
toJSON :: MaxWordLength -> Value
$ctoJSON :: MaxWordLength -> Value
ToJSON)
newtype MinWordLength = MinWordLength Int  deriving (MinWordLength -> MinWordLength -> Bool
(MinWordLength -> MinWordLength -> Bool)
-> (MinWordLength -> MinWordLength -> Bool) -> Eq MinWordLength
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MinWordLength -> MinWordLength -> Bool
$c/= :: MinWordLength -> MinWordLength -> Bool
== :: MinWordLength -> MinWordLength -> Bool
$c== :: MinWordLength -> MinWordLength -> Bool
Eq, Int -> MinWordLength -> ShowS
[MinWordLength] -> ShowS
MinWordLength -> String
(Int -> MinWordLength -> ShowS)
-> (MinWordLength -> String)
-> ([MinWordLength] -> ShowS)
-> Show MinWordLength
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MinWordLength] -> ShowS
$cshowList :: [MinWordLength] -> ShowS
show :: MinWordLength -> String
$cshow :: MinWordLength -> String
showsPrec :: Int -> MinWordLength -> ShowS
$cshowsPrec :: Int -> MinWordLength -> ShowS
Show, Value -> Parser [MinWordLength]
Value -> Parser MinWordLength
(Value -> Parser MinWordLength)
-> (Value -> Parser [MinWordLength]) -> FromJSON MinWordLength
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MinWordLength]
$cparseJSONList :: Value -> Parser [MinWordLength]
parseJSON :: Value -> Parser MinWordLength
$cparseJSON :: Value -> Parser MinWordLength
FromJSON, [MinWordLength] -> Encoding
[MinWordLength] -> Value
MinWordLength -> Encoding
MinWordLength -> Value
(MinWordLength -> Value)
-> (MinWordLength -> Encoding)
-> ([MinWordLength] -> Value)
-> ([MinWordLength] -> Encoding)
-> ToJSON MinWordLength
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MinWordLength] -> Encoding
$ctoEncodingList :: [MinWordLength] -> Encoding
toJSONList :: [MinWordLength] -> Value
$ctoJSONList :: [MinWordLength] -> Value
toEncoding :: MinWordLength -> Encoding
$ctoEncoding :: MinWordLength -> Encoding
toJSON :: MinWordLength -> Value
$ctoJSON :: MinWordLength -> Value
ToJSON)

{-| 'PhraseSlop' sets the default slop for phrases, 0 means exact
     phrase matches. Default is 0.
-}
newtype PhraseSlop      = PhraseSlop      Int deriving (PhraseSlop -> PhraseSlop -> Bool
(PhraseSlop -> PhraseSlop -> Bool)
-> (PhraseSlop -> PhraseSlop -> Bool) -> Eq PhraseSlop
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhraseSlop -> PhraseSlop -> Bool
$c/= :: PhraseSlop -> PhraseSlop -> Bool
== :: PhraseSlop -> PhraseSlop -> Bool
$c== :: PhraseSlop -> PhraseSlop -> Bool
Eq, Int -> PhraseSlop -> ShowS
[PhraseSlop] -> ShowS
PhraseSlop -> String
(Int -> PhraseSlop -> ShowS)
-> (PhraseSlop -> String)
-> ([PhraseSlop] -> ShowS)
-> Show PhraseSlop
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhraseSlop] -> ShowS
$cshowList :: [PhraseSlop] -> ShowS
show :: PhraseSlop -> String
$cshow :: PhraseSlop -> String
showsPrec :: Int -> PhraseSlop -> ShowS
$cshowsPrec :: Int -> PhraseSlop -> ShowS
Show, Value -> Parser [PhraseSlop]
Value -> Parser PhraseSlop
(Value -> Parser PhraseSlop)
-> (Value -> Parser [PhraseSlop]) -> FromJSON PhraseSlop
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [PhraseSlop]
$cparseJSONList :: Value -> Parser [PhraseSlop]
parseJSON :: Value -> Parser PhraseSlop
$cparseJSON :: Value -> Parser PhraseSlop
FromJSON, [PhraseSlop] -> Encoding
[PhraseSlop] -> Value
PhraseSlop -> Encoding
PhraseSlop -> Value
(PhraseSlop -> Value)
-> (PhraseSlop -> Encoding)
-> ([PhraseSlop] -> Value)
-> ([PhraseSlop] -> Encoding)
-> ToJSON PhraseSlop
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [PhraseSlop] -> Encoding
$ctoEncodingList :: [PhraseSlop] -> Encoding
toJSONList :: [PhraseSlop] -> Value
$ctoJSONList :: [PhraseSlop] -> Value
toEncoding :: PhraseSlop -> Encoding
$ctoEncoding :: PhraseSlop -> Encoding
toJSON :: PhraseSlop -> Value
$ctoJSON :: PhraseSlop -> Value
ToJSON)
newtype MinDocFrequency = MinDocFrequency Int deriving (MinDocFrequency -> MinDocFrequency -> Bool
(MinDocFrequency -> MinDocFrequency -> Bool)
-> (MinDocFrequency -> MinDocFrequency -> Bool)
-> Eq MinDocFrequency
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MinDocFrequency -> MinDocFrequency -> Bool
$c/= :: MinDocFrequency -> MinDocFrequency -> Bool
== :: MinDocFrequency -> MinDocFrequency -> Bool
$c== :: MinDocFrequency -> MinDocFrequency -> Bool
Eq, Int -> MinDocFrequency -> ShowS
[MinDocFrequency] -> ShowS
MinDocFrequency -> String
(Int -> MinDocFrequency -> ShowS)
-> (MinDocFrequency -> String)
-> ([MinDocFrequency] -> ShowS)
-> Show MinDocFrequency
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MinDocFrequency] -> ShowS
$cshowList :: [MinDocFrequency] -> ShowS
show :: MinDocFrequency -> String
$cshow :: MinDocFrequency -> String
showsPrec :: Int -> MinDocFrequency -> ShowS
$cshowsPrec :: Int -> MinDocFrequency -> ShowS
Show, Value -> Parser [MinDocFrequency]
Value -> Parser MinDocFrequency
(Value -> Parser MinDocFrequency)
-> (Value -> Parser [MinDocFrequency]) -> FromJSON MinDocFrequency
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MinDocFrequency]
$cparseJSONList :: Value -> Parser [MinDocFrequency]
parseJSON :: Value -> Parser MinDocFrequency
$cparseJSON :: Value -> Parser MinDocFrequency
FromJSON, [MinDocFrequency] -> Encoding
[MinDocFrequency] -> Value
MinDocFrequency -> Encoding
MinDocFrequency -> Value
(MinDocFrequency -> Value)
-> (MinDocFrequency -> Encoding)
-> ([MinDocFrequency] -> Value)
-> ([MinDocFrequency] -> Encoding)
-> ToJSON MinDocFrequency
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MinDocFrequency] -> Encoding
$ctoEncodingList :: [MinDocFrequency] -> Encoding
toJSONList :: [MinDocFrequency] -> Value
$ctoJSONList :: [MinDocFrequency] -> Value
toEncoding :: MinDocFrequency -> Encoding
$ctoEncoding :: MinDocFrequency -> Encoding
toJSON :: MinDocFrequency -> Value
$ctoJSON :: MinDocFrequency -> Value
ToJSON)
newtype MaxDocFrequency = MaxDocFrequency Int deriving (MaxDocFrequency -> MaxDocFrequency -> Bool
(MaxDocFrequency -> MaxDocFrequency -> Bool)
-> (MaxDocFrequency -> MaxDocFrequency -> Bool)
-> Eq MaxDocFrequency
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaxDocFrequency -> MaxDocFrequency -> Bool
$c/= :: MaxDocFrequency -> MaxDocFrequency -> Bool
== :: MaxDocFrequency -> MaxDocFrequency -> Bool
$c== :: MaxDocFrequency -> MaxDocFrequency -> Bool
Eq, Int -> MaxDocFrequency -> ShowS
[MaxDocFrequency] -> ShowS
MaxDocFrequency -> String
(Int -> MaxDocFrequency -> ShowS)
-> (MaxDocFrequency -> String)
-> ([MaxDocFrequency] -> ShowS)
-> Show MaxDocFrequency
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaxDocFrequency] -> ShowS
$cshowList :: [MaxDocFrequency] -> ShowS
show :: MaxDocFrequency -> String
$cshow :: MaxDocFrequency -> String
showsPrec :: Int -> MaxDocFrequency -> ShowS
$cshowsPrec :: Int -> MaxDocFrequency -> ShowS
Show, Value -> Parser [MaxDocFrequency]
Value -> Parser MaxDocFrequency
(Value -> Parser MaxDocFrequency)
-> (Value -> Parser [MaxDocFrequency]) -> FromJSON MaxDocFrequency
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MaxDocFrequency]
$cparseJSONList :: Value -> Parser [MaxDocFrequency]
parseJSON :: Value -> Parser MaxDocFrequency
$cparseJSON :: Value -> Parser MaxDocFrequency
FromJSON, [MaxDocFrequency] -> Encoding
[MaxDocFrequency] -> Value
MaxDocFrequency -> Encoding
MaxDocFrequency -> Value
(MaxDocFrequency -> Value)
-> (MaxDocFrequency -> Encoding)
-> ([MaxDocFrequency] -> Value)
-> ([MaxDocFrequency] -> Encoding)
-> ToJSON MaxDocFrequency
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MaxDocFrequency] -> Encoding
$ctoEncodingList :: [MaxDocFrequency] -> Encoding
toJSONList :: [MaxDocFrequency] -> Value
$ctoJSONList :: [MaxDocFrequency] -> Value
toEncoding :: MaxDocFrequency -> Encoding
$ctoEncoding :: MaxDocFrequency -> Encoding
toJSON :: MaxDocFrequency -> Value
$ctoJSON :: MaxDocFrequency -> Value
ToJSON)

-- | Indicates whether the relevance score of a matching parent document is aggregated into its child documents.
newtype AggregateParentScore = AggregateParentScore Bool deriving (AggregateParentScore -> AggregateParentScore -> Bool
(AggregateParentScore -> AggregateParentScore -> Bool)
-> (AggregateParentScore -> AggregateParentScore -> Bool)
-> Eq AggregateParentScore
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AggregateParentScore -> AggregateParentScore -> Bool
$c/= :: AggregateParentScore -> AggregateParentScore -> Bool
== :: AggregateParentScore -> AggregateParentScore -> Bool
$c== :: AggregateParentScore -> AggregateParentScore -> Bool
Eq, Int -> AggregateParentScore -> ShowS
[AggregateParentScore] -> ShowS
AggregateParentScore -> String
(Int -> AggregateParentScore -> ShowS)
-> (AggregateParentScore -> String)
-> ([AggregateParentScore] -> ShowS)
-> Show AggregateParentScore
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AggregateParentScore] -> ShowS
$cshowList :: [AggregateParentScore] -> ShowS
show :: AggregateParentScore -> String
$cshow :: AggregateParentScore -> String
showsPrec :: Int -> AggregateParentScore -> ShowS
$cshowsPrec :: Int -> AggregateParentScore -> ShowS
Show, Value -> Parser [AggregateParentScore]
Value -> Parser AggregateParentScore
(Value -> Parser AggregateParentScore)
-> (Value -> Parser [AggregateParentScore])
-> FromJSON AggregateParentScore
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AggregateParentScore]
$cparseJSONList :: Value -> Parser [AggregateParentScore]
parseJSON :: Value -> Parser AggregateParentScore
$cparseJSON :: Value -> Parser AggregateParentScore
FromJSON, [AggregateParentScore] -> Encoding
[AggregateParentScore] -> Value
AggregateParentScore -> Encoding
AggregateParentScore -> Value
(AggregateParentScore -> Value)
-> (AggregateParentScore -> Encoding)
-> ([AggregateParentScore] -> Value)
-> ([AggregateParentScore] -> Encoding)
-> ToJSON AggregateParentScore
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AggregateParentScore] -> Encoding
$ctoEncodingList :: [AggregateParentScore] -> Encoding
toJSONList :: [AggregateParentScore] -> Value
$ctoJSONList :: [AggregateParentScore] -> Value
toEncoding :: AggregateParentScore -> Encoding
$ctoEncoding :: AggregateParentScore -> Encoding
toJSON :: AggregateParentScore -> Value
$ctoJSON :: AggregateParentScore -> Value
ToJSON)

-- | Indicates whether to ignore an unmapped parent_type and not return any documents instead of an error.
newtype IgnoreUnmapped  = IgnoreUnmapped Bool deriving (IgnoreUnmapped -> IgnoreUnmapped -> Bool
(IgnoreUnmapped -> IgnoreUnmapped -> Bool)
-> (IgnoreUnmapped -> IgnoreUnmapped -> Bool) -> Eq IgnoreUnmapped
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IgnoreUnmapped -> IgnoreUnmapped -> Bool
$c/= :: IgnoreUnmapped -> IgnoreUnmapped -> Bool
== :: IgnoreUnmapped -> IgnoreUnmapped -> Bool
$c== :: IgnoreUnmapped -> IgnoreUnmapped -> Bool
Eq, Int -> IgnoreUnmapped -> ShowS
[IgnoreUnmapped] -> ShowS
IgnoreUnmapped -> String
(Int -> IgnoreUnmapped -> ShowS)
-> (IgnoreUnmapped -> String)
-> ([IgnoreUnmapped] -> ShowS)
-> Show IgnoreUnmapped
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IgnoreUnmapped] -> ShowS
$cshowList :: [IgnoreUnmapped] -> ShowS
show :: IgnoreUnmapped -> String
$cshow :: IgnoreUnmapped -> String
showsPrec :: Int -> IgnoreUnmapped -> ShowS
$cshowsPrec :: Int -> IgnoreUnmapped -> ShowS
Show, Value -> Parser [IgnoreUnmapped]
Value -> Parser IgnoreUnmapped
(Value -> Parser IgnoreUnmapped)
-> (Value -> Parser [IgnoreUnmapped]) -> FromJSON IgnoreUnmapped
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [IgnoreUnmapped]
$cparseJSONList :: Value -> Parser [IgnoreUnmapped]
parseJSON :: Value -> Parser IgnoreUnmapped
$cparseJSON :: Value -> Parser IgnoreUnmapped
FromJSON, [IgnoreUnmapped] -> Encoding
[IgnoreUnmapped] -> Value
IgnoreUnmapped -> Encoding
IgnoreUnmapped -> Value
(IgnoreUnmapped -> Value)
-> (IgnoreUnmapped -> Encoding)
-> ([IgnoreUnmapped] -> Value)
-> ([IgnoreUnmapped] -> Encoding)
-> ToJSON IgnoreUnmapped
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [IgnoreUnmapped] -> Encoding
$ctoEncodingList :: [IgnoreUnmapped] -> Encoding
toJSONList :: [IgnoreUnmapped] -> Value
$ctoJSONList :: [IgnoreUnmapped] -> Value
toEncoding :: IgnoreUnmapped -> Encoding
$ctoEncoding :: IgnoreUnmapped -> Encoding
toJSON :: IgnoreUnmapped -> Value
$ctoJSON :: IgnoreUnmapped -> Value
ToJSON)

{-| Maximum number of child documents that match the query allowed for a returned parent document.
    If the parent document exceeds this limit, it is excluded from the search results.
-}
newtype MinChildren     = MinChildren Int     deriving (MinChildren -> MinChildren -> Bool
(MinChildren -> MinChildren -> Bool)
-> (MinChildren -> MinChildren -> Bool) -> Eq MinChildren
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MinChildren -> MinChildren -> Bool
$c/= :: MinChildren -> MinChildren -> Bool
== :: MinChildren -> MinChildren -> Bool
$c== :: MinChildren -> MinChildren -> Bool
Eq, Int -> MinChildren -> ShowS
[MinChildren] -> ShowS
MinChildren -> String
(Int -> MinChildren -> ShowS)
-> (MinChildren -> String)
-> ([MinChildren] -> ShowS)
-> Show MinChildren
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MinChildren] -> ShowS
$cshowList :: [MinChildren] -> ShowS
show :: MinChildren -> String
$cshow :: MinChildren -> String
showsPrec :: Int -> MinChildren -> ShowS
$cshowsPrec :: Int -> MinChildren -> ShowS
Show, Value -> Parser [MinChildren]
Value -> Parser MinChildren
(Value -> Parser MinChildren)
-> (Value -> Parser [MinChildren]) -> FromJSON MinChildren
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MinChildren]
$cparseJSONList :: Value -> Parser [MinChildren]
parseJSON :: Value -> Parser MinChildren
$cparseJSON :: Value -> Parser MinChildren
FromJSON, [MinChildren] -> Encoding
[MinChildren] -> Value
MinChildren -> Encoding
MinChildren -> Value
(MinChildren -> Value)
-> (MinChildren -> Encoding)
-> ([MinChildren] -> Value)
-> ([MinChildren] -> Encoding)
-> ToJSON MinChildren
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MinChildren] -> Encoding
$ctoEncodingList :: [MinChildren] -> Encoding
toJSONList :: [MinChildren] -> Value
$ctoJSONList :: [MinChildren] -> Value
toEncoding :: MinChildren -> Encoding
$ctoEncoding :: MinChildren -> Encoding
toJSON :: MinChildren -> Value
$ctoJSON :: MinChildren -> Value
ToJSON)

{-| Minimum number of child documents that match the query required to match the query for a returned parent document.
    If the parent document does not meet this limit, it is excluded from the search results.
-}
newtype MaxChildren     = MaxChildren Int     deriving (MaxChildren -> MaxChildren -> Bool
(MaxChildren -> MaxChildren -> Bool)
-> (MaxChildren -> MaxChildren -> Bool) -> Eq MaxChildren
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaxChildren -> MaxChildren -> Bool
$c/= :: MaxChildren -> MaxChildren -> Bool
== :: MaxChildren -> MaxChildren -> Bool
$c== :: MaxChildren -> MaxChildren -> Bool
Eq, Int -> MaxChildren -> ShowS
[MaxChildren] -> ShowS
MaxChildren -> String
(Int -> MaxChildren -> ShowS)
-> (MaxChildren -> String)
-> ([MaxChildren] -> ShowS)
-> Show MaxChildren
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaxChildren] -> ShowS
$cshowList :: [MaxChildren] -> ShowS
show :: MaxChildren -> String
$cshow :: MaxChildren -> String
showsPrec :: Int -> MaxChildren -> ShowS
$cshowsPrec :: Int -> MaxChildren -> ShowS
Show, Value -> Parser [MaxChildren]
Value -> Parser MaxChildren
(Value -> Parser MaxChildren)
-> (Value -> Parser [MaxChildren]) -> FromJSON MaxChildren
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [MaxChildren]
$cparseJSONList :: Value -> Parser [MaxChildren]
parseJSON :: Value -> Parser MaxChildren
$cparseJSON :: Value -> Parser MaxChildren
FromJSON, [MaxChildren] -> Encoding
[MaxChildren] -> Value
MaxChildren -> Encoding
MaxChildren -> Value
(MaxChildren -> Value)
-> (MaxChildren -> Encoding)
-> ([MaxChildren] -> Value)
-> ([MaxChildren] -> Encoding)
-> ToJSON MaxChildren
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [MaxChildren] -> Encoding
$ctoEncodingList :: [MaxChildren] -> Encoding
toJSONList :: [MaxChildren] -> Value
$ctoJSONList :: [MaxChildren] -> Value
toEncoding :: MaxChildren -> Encoding
$ctoEncoding :: MaxChildren -> Encoding
toJSON :: MaxChildren -> Value
$ctoJSON :: MaxChildren -> Value
ToJSON)

-- | Newtype wrapper to parse ES's concerning tendency to in some APIs return a floating point number of milliseconds since epoch ಠ_ಠ
newtype POSIXMS = POSIXMS { POSIXMS -> UTCTime
posixMS :: UTCTime }

instance FromJSON POSIXMS where
  parseJSON :: Value -> Parser POSIXMS
parseJSON = String -> (Scientific -> Parser POSIXMS) -> Value -> Parser POSIXMS
forall a. String -> (Scientific -> Parser a) -> Value -> Parser a
withScientific String
"POSIXMS" (POSIXMS -> Parser POSIXMS
forall (m :: * -> *) a. Monad m => a -> m a
return (POSIXMS -> Parser POSIXMS)
-> (Scientific -> POSIXMS) -> Scientific -> Parser POSIXMS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Scientific -> POSIXMS
forall a. RealFrac a => a -> POSIXMS
parse)
    where parse :: a -> POSIXMS
parse a
n =
            let n' :: Integer
n' = a -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate a
n :: Integer
            in UTCTime -> POSIXMS
POSIXMS (POSIXTime -> UTCTime
posixSecondsToUTCTime (Integer -> POSIXTime
forall a. Num a => Integer -> a
fromInteger (Integer
n' Integer -> Integer -> Integer
forall a. Integral a => a -> a -> a
`div` Integer
1000)))

newtype Boost =
  Boost Double
  deriving (Boost -> Boost -> Bool
(Boost -> Boost -> Bool) -> (Boost -> Boost -> Bool) -> Eq Boost
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Boost -> Boost -> Bool
$c/= :: Boost -> Boost -> Bool
== :: Boost -> Boost -> Bool
$c== :: Boost -> Boost -> Bool
Eq, Int -> Boost -> ShowS
[Boost] -> ShowS
Boost -> String
(Int -> Boost -> ShowS)
-> (Boost -> String) -> ([Boost] -> ShowS) -> Show Boost
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Boost] -> ShowS
$cshowList :: [Boost] -> ShowS
show :: Boost -> String
$cshow :: Boost -> String
showsPrec :: Int -> Boost -> ShowS
$cshowsPrec :: Int -> Boost -> ShowS
Show, [Boost] -> Encoding
[Boost] -> Value
Boost -> Encoding
Boost -> Value
(Boost -> Value)
-> (Boost -> Encoding)
-> ([Boost] -> Value)
-> ([Boost] -> Encoding)
-> ToJSON Boost
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Boost] -> Encoding
$ctoEncodingList :: [Boost] -> Encoding
toJSONList :: [Boost] -> Value
$ctoJSONList :: [Boost] -> Value
toEncoding :: Boost -> Encoding
$ctoEncoding :: Boost -> Encoding
toJSON :: Boost -> Value
$ctoJSON :: Boost -> Value
ToJSON, Value -> Parser [Boost]
Value -> Parser Boost
(Value -> Parser Boost)
-> (Value -> Parser [Boost]) -> FromJSON Boost
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Boost]
$cparseJSONList :: Value -> Parser [Boost]
parseJSON :: Value -> Parser Boost
$cparseJSON :: Value -> Parser Boost
FromJSON)

newtype BoostTerms =
  BoostTerms Double
  deriving (BoostTerms -> BoostTerms -> Bool
(BoostTerms -> BoostTerms -> Bool)
-> (BoostTerms -> BoostTerms -> Bool) -> Eq BoostTerms
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BoostTerms -> BoostTerms -> Bool
$c/= :: BoostTerms -> BoostTerms -> Bool
== :: BoostTerms -> BoostTerms -> Bool
$c== :: BoostTerms -> BoostTerms -> Bool
Eq, Int -> BoostTerms -> ShowS
[BoostTerms] -> ShowS
BoostTerms -> String
(Int -> BoostTerms -> ShowS)
-> (BoostTerms -> String)
-> ([BoostTerms] -> ShowS)
-> Show BoostTerms
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BoostTerms] -> ShowS
$cshowList :: [BoostTerms] -> ShowS
show :: BoostTerms -> String
$cshow :: BoostTerms -> String
showsPrec :: Int -> BoostTerms -> ShowS
$cshowsPrec :: Int -> BoostTerms -> ShowS
Show, [BoostTerms] -> Encoding
[BoostTerms] -> Value
BoostTerms -> Encoding
BoostTerms -> Value
(BoostTerms -> Value)
-> (BoostTerms -> Encoding)
-> ([BoostTerms] -> Value)
-> ([BoostTerms] -> Encoding)
-> ToJSON BoostTerms
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [BoostTerms] -> Encoding
$ctoEncodingList :: [BoostTerms] -> Encoding
toJSONList :: [BoostTerms] -> Value
$ctoJSONList :: [BoostTerms] -> Value
toEncoding :: BoostTerms -> Encoding
$ctoEncoding :: BoostTerms -> Encoding
toJSON :: BoostTerms -> Value
$ctoJSON :: BoostTerms -> Value
ToJSON, Value -> Parser [BoostTerms]
Value -> Parser BoostTerms
(Value -> Parser BoostTerms)
-> (Value -> Parser [BoostTerms]) -> FromJSON BoostTerms
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [BoostTerms]
$cparseJSONList :: Value -> Parser [BoostTerms]
parseJSON :: Value -> Parser BoostTerms
$cparseJSON :: Value -> Parser BoostTerms
FromJSON)

{-| 'ReplicaCount' is part of 'IndexSettings' -}
newtype ReplicaCount =
  ReplicaCount Int
  deriving (ReplicaCount -> ReplicaCount -> Bool
(ReplicaCount -> ReplicaCount -> Bool)
-> (ReplicaCount -> ReplicaCount -> Bool) -> Eq ReplicaCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReplicaCount -> ReplicaCount -> Bool
$c/= :: ReplicaCount -> ReplicaCount -> Bool
== :: ReplicaCount -> ReplicaCount -> Bool
$c== :: ReplicaCount -> ReplicaCount -> Bool
Eq, Int -> ReplicaCount -> ShowS
[ReplicaCount] -> ShowS
ReplicaCount -> String
(Int -> ReplicaCount -> ShowS)
-> (ReplicaCount -> String)
-> ([ReplicaCount] -> ShowS)
-> Show ReplicaCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReplicaCount] -> ShowS
$cshowList :: [ReplicaCount] -> ShowS
show :: ReplicaCount -> String
$cshow :: ReplicaCount -> String
showsPrec :: Int -> ReplicaCount -> ShowS
$cshowsPrec :: Int -> ReplicaCount -> ShowS
Show, [ReplicaCount] -> Encoding
[ReplicaCount] -> Value
ReplicaCount -> Encoding
ReplicaCount -> Value
(ReplicaCount -> Value)
-> (ReplicaCount -> Encoding)
-> ([ReplicaCount] -> Value)
-> ([ReplicaCount] -> Encoding)
-> ToJSON ReplicaCount
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ReplicaCount] -> Encoding
$ctoEncodingList :: [ReplicaCount] -> Encoding
toJSONList :: [ReplicaCount] -> Value
$ctoJSONList :: [ReplicaCount] -> Value
toEncoding :: ReplicaCount -> Encoding
$ctoEncoding :: ReplicaCount -> Encoding
toJSON :: ReplicaCount -> Value
$ctoJSON :: ReplicaCount -> Value
ToJSON)

{-| 'ShardCount' is part of 'IndexSettings' -}
newtype ShardCount =
  ShardCount Int
  deriving (ShardCount -> ShardCount -> Bool
(ShardCount -> ShardCount -> Bool)
-> (ShardCount -> ShardCount -> Bool) -> Eq ShardCount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShardCount -> ShardCount -> Bool
$c/= :: ShardCount -> ShardCount -> Bool
== :: ShardCount -> ShardCount -> Bool
$c== :: ShardCount -> ShardCount -> Bool
Eq, Int -> ShardCount -> ShowS
[ShardCount] -> ShowS
ShardCount -> String
(Int -> ShardCount -> ShowS)
-> (ShardCount -> String)
-> ([ShardCount] -> ShowS)
-> Show ShardCount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShardCount] -> ShowS
$cshowList :: [ShardCount] -> ShowS
show :: ShardCount -> String
$cshow :: ShardCount -> String
showsPrec :: Int -> ShardCount -> ShowS
$cshowsPrec :: Int -> ShardCount -> ShowS
Show, [ShardCount] -> Encoding
[ShardCount] -> Value
ShardCount -> Encoding
ShardCount -> Value
(ShardCount -> Value)
-> (ShardCount -> Encoding)
-> ([ShardCount] -> Value)
-> ([ShardCount] -> Encoding)
-> ToJSON ShardCount
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ShardCount] -> Encoding
$ctoEncodingList :: [ShardCount] -> Encoding
toJSONList :: [ShardCount] -> Value
$ctoJSONList :: [ShardCount] -> Value
toEncoding :: ShardCount -> Encoding
$ctoEncoding :: ShardCount -> Encoding
toJSON :: ShardCount -> Value
$ctoJSON :: ShardCount -> Value
ToJSON)

-- This insanity is because ES *sometimes* returns Replica/Shard counts as strings
instance FromJSON ReplicaCount where
  parseJSON :: Value -> Parser ReplicaCount
parseJSON Value
v = Value -> Parser ReplicaCount
parseAsInt Value
v
            Parser ReplicaCount -> Parser ReplicaCount -> Parser ReplicaCount
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Value -> Parser ReplicaCount
parseAsString Value
v
    where parseAsInt :: Value -> Parser ReplicaCount
parseAsInt = (Int -> ReplicaCount) -> Parser Int -> Parser ReplicaCount
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> ReplicaCount
ReplicaCount (Parser Int -> Parser ReplicaCount)
-> (Value -> Parser Int) -> Value -> Parser ReplicaCount
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Parser Int
forall a. FromJSON a => Value -> Parser a
parseJSON
          parseAsString :: Value -> Parser ReplicaCount
parseAsString = String
-> (Text -> Parser ReplicaCount) -> Value -> Parser ReplicaCount
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"ReplicaCount" ((Int -> ReplicaCount) -> Parser Int -> Parser ReplicaCount
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> ReplicaCount
ReplicaCount (Parser Int -> Parser ReplicaCount)
-> (Text -> Parser Int) -> Text -> Parser ReplicaCount
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Parser Int
forall a. Read a => Text -> Parser a
parseReadText)

instance FromJSON ShardCount where
  parseJSON :: Value -> Parser ShardCount
parseJSON Value
v = Value -> Parser ShardCount
parseAsInt Value
v
            Parser ShardCount -> Parser ShardCount -> Parser ShardCount
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> Value -> Parser ShardCount
parseAsString Value
v
    where parseAsInt :: Value -> Parser ShardCount
parseAsInt = (Int -> ShardCount) -> Parser Int -> Parser ShardCount
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> ShardCount
ShardCount (Parser Int -> Parser ShardCount)
-> (Value -> Parser Int) -> Value -> Parser ShardCount
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Parser Int
forall a. FromJSON a => Value -> Parser a
parseJSON
          parseAsString :: Value -> Parser ShardCount
parseAsString = String -> (Text -> Parser ShardCount) -> Value -> Parser ShardCount
forall a. String -> (Text -> Parser a) -> Value -> Parser a
withText String
"ShardCount" ((Int -> ShardCount) -> Parser Int -> Parser ShardCount
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> ShardCount
ShardCount (Parser Int -> Parser ShardCount)
-> (Text -> Parser Int) -> Text -> Parser ShardCount
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Parser Int
forall a. Read a => Text -> Parser a
parseReadText)

{-| 'IndexName' is used to describe which index to query/create/delete -}
newtype IndexName =
  IndexName Text
  deriving (IndexName -> IndexName -> Bool
(IndexName -> IndexName -> Bool)
-> (IndexName -> IndexName -> Bool) -> Eq IndexName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexName -> IndexName -> Bool
$c/= :: IndexName -> IndexName -> Bool
== :: IndexName -> IndexName -> Bool
$c== :: IndexName -> IndexName -> Bool
Eq, Int -> IndexName -> ShowS
[IndexName] -> ShowS
IndexName -> String
(Int -> IndexName -> ShowS)
-> (IndexName -> String)
-> ([IndexName] -> ShowS)
-> Show IndexName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IndexName] -> ShowS
$cshowList :: [IndexName] -> ShowS
show :: IndexName -> String
$cshow :: IndexName -> String
showsPrec :: Int -> IndexName -> ShowS
$cshowsPrec :: Int -> IndexName -> ShowS
Show, [IndexName] -> Encoding
[IndexName] -> Value
IndexName -> Encoding
IndexName -> Value
(IndexName -> Value)
-> (IndexName -> Encoding)
-> ([IndexName] -> Value)
-> ([IndexName] -> Encoding)
-> ToJSON IndexName
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [IndexName] -> Encoding
$ctoEncodingList :: [IndexName] -> Encoding
toJSONList :: [IndexName] -> Value
$ctoJSONList :: [IndexName] -> Value
toEncoding :: IndexName -> Encoding
$ctoEncoding :: IndexName -> Encoding
toJSON :: IndexName -> Value
$ctoJSON :: IndexName -> Value
ToJSON, Value -> Parser [IndexName]
Value -> Parser IndexName
(Value -> Parser IndexName)
-> (Value -> Parser [IndexName]) -> FromJSON IndexName
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [IndexName]
$cparseJSONList :: Value -> Parser [IndexName]
parseJSON :: Value -> Parser IndexName
$cparseJSON :: Value -> Parser IndexName
FromJSON)

newtype IndexAliasName =
  IndexAliasName { IndexAliasName -> IndexName
indexAliasName :: IndexName }
  deriving (IndexAliasName -> IndexAliasName -> Bool
(IndexAliasName -> IndexAliasName -> Bool)
-> (IndexAliasName -> IndexAliasName -> Bool) -> Eq IndexAliasName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexAliasName -> IndexAliasName -> Bool
$c/= :: IndexAliasName -> IndexAliasName -> Bool
== :: IndexAliasName -> IndexAliasName -> Bool
$c== :: IndexAliasName -> IndexAliasName -> Bool
Eq, Int -> IndexAliasName -> ShowS
[IndexAliasName] -> ShowS
IndexAliasName -> String
(Int -> IndexAliasName -> ShowS)
-> (IndexAliasName -> String)
-> ([IndexAliasName] -> ShowS)
-> Show IndexAliasName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IndexAliasName] -> ShowS
$cshowList :: [IndexAliasName] -> ShowS
show :: IndexAliasName -> String
$cshow :: IndexAliasName -> String
showsPrec :: Int -> IndexAliasName -> ShowS
$cshowsPrec :: Int -> IndexAliasName -> ShowS
Show, [IndexAliasName] -> Encoding
[IndexAliasName] -> Value
IndexAliasName -> Encoding
IndexAliasName -> Value
(IndexAliasName -> Value)
-> (IndexAliasName -> Encoding)
-> ([IndexAliasName] -> Value)
-> ([IndexAliasName] -> Encoding)
-> ToJSON IndexAliasName
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [IndexAliasName] -> Encoding
$ctoEncodingList :: [IndexAliasName] -> Encoding
toJSONList :: [IndexAliasName] -> Value
$ctoJSONList :: [IndexAliasName] -> Value
toEncoding :: IndexAliasName -> Encoding
$ctoEncoding :: IndexAliasName -> Encoding
toJSON :: IndexAliasName -> Value
$ctoJSON :: IndexAliasName -> Value
ToJSON)

newtype MaybeNA a = MaybeNA { MaybeNA a -> Maybe a
unMaybeNA :: Maybe a }
  deriving (Int -> MaybeNA a -> ShowS
[MaybeNA a] -> ShowS
MaybeNA a -> String
(Int -> MaybeNA a -> ShowS)
-> (MaybeNA a -> String)
-> ([MaybeNA a] -> ShowS)
-> Show (MaybeNA a)
forall a. Show a => Int -> MaybeNA a -> ShowS
forall a. Show a => [MaybeNA a] -> ShowS
forall a. Show a => MaybeNA a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MaybeNA a] -> ShowS
$cshowList :: forall a. Show a => [MaybeNA a] -> ShowS
show :: MaybeNA a -> String
$cshow :: forall a. Show a => MaybeNA a -> String
showsPrec :: Int -> MaybeNA a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> MaybeNA a -> ShowS
Show, MaybeNA a -> MaybeNA a -> Bool
(MaybeNA a -> MaybeNA a -> Bool)
-> (MaybeNA a -> MaybeNA a -> Bool) -> Eq (MaybeNA a)
forall a. Eq a => MaybeNA a -> MaybeNA a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MaybeNA a -> MaybeNA a -> Bool
$c/= :: forall a. Eq a => MaybeNA a -> MaybeNA a -> Bool
== :: MaybeNA a -> MaybeNA a -> Bool
$c== :: forall a. Eq a => MaybeNA a -> MaybeNA a -> Bool
Eq)

instance FromJSON a => FromJSON (MaybeNA a) where
  parseJSON :: Value -> Parser (MaybeNA a)
parseJSON (String Text
"NA") = MaybeNA a -> Parser (MaybeNA a)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MaybeNA a -> Parser (MaybeNA a))
-> MaybeNA a -> Parser (MaybeNA a)
forall a b. (a -> b) -> a -> b
$ Maybe a -> MaybeNA a
forall a. Maybe a -> MaybeNA a
MaybeNA Maybe a
forall a. Maybe a
Nothing
  parseJSON Value
o             = Maybe a -> MaybeNA a
forall a. Maybe a -> MaybeNA a
MaybeNA (Maybe a -> MaybeNA a) -> (a -> Maybe a) -> a -> MaybeNA a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Maybe a
forall a. a -> Maybe a
Just (a -> MaybeNA a) -> Parser a -> Parser (MaybeNA a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser a
forall a. FromJSON a => Value -> Parser a
parseJSON Value
o

newtype SnapshotName =
  SnapshotName { SnapshotName -> Text
snapshotName :: Text }
  deriving (SnapshotName -> SnapshotName -> Bool
(SnapshotName -> SnapshotName -> Bool)
-> (SnapshotName -> SnapshotName -> Bool) -> Eq SnapshotName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnapshotName -> SnapshotName -> Bool
$c/= :: SnapshotName -> SnapshotName -> Bool
== :: SnapshotName -> SnapshotName -> Bool
$c== :: SnapshotName -> SnapshotName -> Bool
Eq, Int -> SnapshotName -> ShowS
[SnapshotName] -> ShowS
SnapshotName -> String
(Int -> SnapshotName -> ShowS)
-> (SnapshotName -> String)
-> ([SnapshotName] -> ShowS)
-> Show SnapshotName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnapshotName] -> ShowS
$cshowList :: [SnapshotName] -> ShowS
show :: SnapshotName -> String
$cshow :: SnapshotName -> String
showsPrec :: Int -> SnapshotName -> ShowS
$cshowsPrec :: Int -> SnapshotName -> ShowS
Show, [SnapshotName] -> Encoding
[SnapshotName] -> Value
SnapshotName -> Encoding
SnapshotName -> Value
(SnapshotName -> Value)
-> (SnapshotName -> Encoding)
-> ([SnapshotName] -> Value)
-> ([SnapshotName] -> Encoding)
-> ToJSON SnapshotName
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [SnapshotName] -> Encoding
$ctoEncodingList :: [SnapshotName] -> Encoding
toJSONList :: [SnapshotName] -> Value
$ctoJSONList :: [SnapshotName] -> Value
toEncoding :: SnapshotName -> Encoding
$ctoEncoding :: SnapshotName -> Encoding
toJSON :: SnapshotName -> Value
$ctoJSON :: SnapshotName -> Value
ToJSON, Value -> Parser [SnapshotName]
Value -> Parser SnapshotName
(Value -> Parser SnapshotName)
-> (Value -> Parser [SnapshotName]) -> FromJSON SnapshotName
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [SnapshotName]
$cparseJSONList :: Value -> Parser [SnapshotName]
parseJSON :: Value -> Parser SnapshotName
$cparseJSON :: Value -> Parser SnapshotName
FromJSON)

-- | Milliseconds
newtype MS = MS NominalDiffTime

-- keeps the unexported constructor warnings at bay
unMS :: MS -> NominalDiffTime
unMS :: MS -> POSIXTime
unMS (MS POSIXTime
t) = POSIXTime
t


instance FromJSON MS where
  parseJSON :: Value -> Parser MS
parseJSON = String -> (Scientific -> Parser MS) -> Value -> Parser MS
forall a. String -> (Scientific -> Parser a) -> Value -> Parser a
withScientific String
"MS" (MS -> Parser MS
forall (m :: * -> *) a. Monad m => a -> m a
return (MS -> Parser MS) -> (Scientific -> MS) -> Scientific -> Parser MS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. POSIXTime -> MS
MS (POSIXTime -> MS) -> (Scientific -> POSIXTime) -> Scientific -> MS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Scientific -> POSIXTime
forall a a. (RealFrac a, Num a) => a -> a
parse)
    where
      parse :: a -> a
parse a
n = Integer -> a
forall a. Num a => Integer -> a
fromInteger (a -> Integer
forall a b. (RealFrac a, Integral b) => a -> b
truncate a
n Integer -> Integer -> Integer
forall a. Num a => a -> a -> a
* Integer
1000)

newtype TokenFilter =
  TokenFilter Text
  deriving (TokenFilter -> TokenFilter -> Bool
(TokenFilter -> TokenFilter -> Bool)
-> (TokenFilter -> TokenFilter -> Bool) -> Eq TokenFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TokenFilter -> TokenFilter -> Bool
$c/= :: TokenFilter -> TokenFilter -> Bool
== :: TokenFilter -> TokenFilter -> Bool
$c== :: TokenFilter -> TokenFilter -> Bool
Eq, Int -> TokenFilter -> ShowS
[TokenFilter] -> ShowS
TokenFilter -> String
(Int -> TokenFilter -> ShowS)
-> (TokenFilter -> String)
-> ([TokenFilter] -> ShowS)
-> Show TokenFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TokenFilter] -> ShowS
$cshowList :: [TokenFilter] -> ShowS
show :: TokenFilter -> String
$cshow :: TokenFilter -> String
showsPrec :: Int -> TokenFilter -> ShowS
$cshowsPrec :: Int -> TokenFilter -> ShowS
Show, Value -> Parser [TokenFilter]
Value -> Parser TokenFilter
(Value -> Parser TokenFilter)
-> (Value -> Parser [TokenFilter]) -> FromJSON TokenFilter
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [TokenFilter]
$cparseJSONList :: Value -> Parser [TokenFilter]
parseJSON :: Value -> Parser TokenFilter
$cparseJSON :: Value -> Parser TokenFilter
FromJSON, [TokenFilter] -> Encoding
[TokenFilter] -> Value
TokenFilter -> Encoding
TokenFilter -> Value
(TokenFilter -> Value)
-> (TokenFilter -> Encoding)
-> ([TokenFilter] -> Value)
-> ([TokenFilter] -> Encoding)
-> ToJSON TokenFilter
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [TokenFilter] -> Encoding
$ctoEncodingList :: [TokenFilter] -> Encoding
toJSONList :: [TokenFilter] -> Value
$ctoJSONList :: [TokenFilter] -> Value
toEncoding :: TokenFilter -> Encoding
$ctoEncoding :: TokenFilter -> Encoding
toJSON :: TokenFilter -> Value
$ctoJSON :: TokenFilter -> Value
ToJSON)

newtype CharFilter =
  CharFilter Text
  deriving (CharFilter -> CharFilter -> Bool
(CharFilter -> CharFilter -> Bool)
-> (CharFilter -> CharFilter -> Bool) -> Eq CharFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CharFilter -> CharFilter -> Bool
$c/= :: CharFilter -> CharFilter -> Bool
== :: CharFilter -> CharFilter -> Bool
$c== :: CharFilter -> CharFilter -> Bool
Eq, Int -> CharFilter -> ShowS
[CharFilter] -> ShowS
CharFilter -> String
(Int -> CharFilter -> ShowS)
-> (CharFilter -> String)
-> ([CharFilter] -> ShowS)
-> Show CharFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CharFilter] -> ShowS
$cshowList :: [CharFilter] -> ShowS
show :: CharFilter -> String
$cshow :: CharFilter -> String
showsPrec :: Int -> CharFilter -> ShowS
$cshowsPrec :: Int -> CharFilter -> ShowS
Show, Value -> Parser [CharFilter]
Value -> Parser CharFilter
(Value -> Parser CharFilter)
-> (Value -> Parser [CharFilter]) -> FromJSON CharFilter
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [CharFilter]
$cparseJSONList :: Value -> Parser [CharFilter]
parseJSON :: Value -> Parser CharFilter
$cparseJSON :: Value -> Parser CharFilter
FromJSON, [CharFilter] -> Encoding
[CharFilter] -> Value
CharFilter -> Encoding
CharFilter -> Value
(CharFilter -> Value)
-> (CharFilter -> Encoding)
-> ([CharFilter] -> Value)
-> ([CharFilter] -> Encoding)
-> ToJSON CharFilter
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [CharFilter] -> Encoding
$ctoEncodingList :: [CharFilter] -> Encoding
toJSONList :: [CharFilter] -> Value
$ctoJSONList :: [CharFilter] -> Value
toEncoding :: CharFilter -> Encoding
$ctoEncoding :: CharFilter -> Encoding
toJSON :: CharFilter -> Value
$ctoJSON :: CharFilter -> Value
ToJSON)