bloodhound-0.16.0.0: Elasticsearch client library for Haskell

Copyright(C) 2014 2018 Chris Allen
LicenseBSD-style (see the file LICENSE)
MaintainerChris Allen <cma@bitemyapp.com
Stabilityprovisional
PortabilityRecordWildCards
Safe HaskellNone
LanguageHaskell2010

Database.V5.Bloodhound.Types

Description

Data types for describing actions and data structures performed to interact with Elasticsearch. The two main buckets your queries against Elasticsearch will fall into are Querys and Filters. Filters are more like traditional database constraints and often have preferable performance properties. Querys support human-written textual queries, such as fuzzy queries.

Synopsis

Documentation

defaultIndexDocumentSettings :: IndexDocumentSettings Source #

Reasonable default settings. Chooses no version control and no parent.

mkSort :: FieldName -> SortOrder -> DefaultSort Source #

mkSort defaults everything but the FieldName and the SortOrder so that you can concisely describe the usual kind of SortSpecs you want.

showText :: Show a => a -> Text Source #

unpackId :: DocId -> Text Source #

unpackId is a silly convenience function that gets used once.

mkMatchQuery :: FieldName -> QueryString -> MatchQuery Source #

mkMatchQuery is a convenience function that defaults the less common parameters, enabling you to provide only the FieldName and QueryString to make a MatchQuery

mkMultiMatchQuery :: [FieldName] -> QueryString -> MultiMatchQuery Source #

mkMultiMatchQuery is a convenience function that defaults the less common parameters, enabling you to provide only the list of FieldNames and QueryString to make a MultiMatchQuery.

mkDocVersion :: Int -> Maybe DocVersion Source #

Smart constructor for in-range doc version

newtype BH m a Source #

Constructors

BH 

Fields

Instances

MonadTrans BH Source # 

Methods

lift :: Monad m => m a -> BH m a #

MonadWriter w m => MonadWriter w (BH m) Source # 

Methods

writer :: (a, w) -> BH m a #

tell :: w -> BH m () #

listen :: BH m a -> BH m (a, w) #

pass :: BH m (a, w -> w) -> BH m a #

MonadState s m => MonadState s (BH m) Source # 

Methods

get :: BH m s #

put :: s -> BH m () #

state :: (s -> (a, s)) -> BH m a #

MonadReader r m => MonadReader r (BH m) Source # 

Methods

ask :: BH m r #

local :: (r -> r) -> BH m a -> BH m a #

reader :: (r -> a) -> BH m a #

MonadError e m => MonadError e (BH m) Source # 

Methods

throwError :: e -> BH m a #

catchError :: BH m a -> (e -> BH m a) -> BH m a #

Monad m => Monad (BH m) Source # 

Methods

(>>=) :: BH m a -> (a -> BH m b) -> BH m b #

(>>) :: BH m a -> BH m b -> BH m b #

return :: a -> BH m a #

fail :: String -> BH m a #

Functor m => Functor (BH m) Source # 

Methods

fmap :: (a -> b) -> BH m a -> BH m b #

(<$) :: a -> BH m b -> BH m a #

MonadFix m => MonadFix (BH m) Source # 

Methods

mfix :: (a -> BH m a) -> BH m a #

Applicative m => Applicative (BH m) Source # 

Methods

pure :: a -> BH m a #

(<*>) :: BH m (a -> b) -> BH m a -> BH m b #

liftA2 :: (a -> b -> c) -> BH m a -> BH m b -> BH m c #

(*>) :: BH m a -> BH m b -> BH m b #

(<*) :: BH m a -> BH m b -> BH m a #

Alternative m => Alternative (BH m) Source # 

Methods

empty :: BH m a #

(<|>) :: BH m a -> BH m a -> BH m a #

some :: BH m a -> BH m [a] #

many :: BH m a -> BH m [a] #

MonadPlus m => MonadPlus (BH m) Source # 

Methods

mzero :: BH m a #

mplus :: BH m a -> BH m a -> BH m a #

MonadIO m => MonadIO (BH m) Source # 

Methods

liftIO :: IO a -> BH m a #

MonadThrow m => MonadThrow (BH m) Source # 

Methods

throwM :: Exception e => e -> BH m a #

MonadCatch m => MonadCatch (BH m) Source # 

Methods

catch :: Exception e => BH m a -> (e -> BH m a) -> BH m a #

MonadMask m => MonadMask (BH m) Source # 

Methods

mask :: ((forall a. BH m a -> BH m a) -> BH m b) -> BH m b #

uninterruptibleMask :: ((forall a. BH m a -> BH m a) -> BH m b) -> BH m b #

generalBracket :: BH m a -> (a -> ExitCase b -> BH m c) -> (a -> BH m b) -> BH m (b, c) #

(Functor m, Applicative m, MonadIO m) => MonadBH (BH m) Source # 

Methods

getBHEnv :: BH m BHEnv Source #

runBH :: BHEnv -> BH m a -> m a Source #

data BHEnv Source #

Common environment for Elasticsearch calls. Connections will be pipelined according to the provided HTTP connection manager.

bhRequestHook :: BHEnv -> Request -> IO Request Source #

Low-level hook that is run before every request is sent. Used to implement custom authentication strategies. Defaults to return with mkBHEnv.

mkBHEnv :: Server -> Manager -> BHEnv Source #

Create a BHEnv with all optional fields defaulted. HTTP hook will be a noop. You can use the exported fields to customize it further, e.g.:

> (mkBHEnv myServer myManager) { bhRequestHook = customHook }

class (Functor m, Applicative m, MonadIO m) => MonadBH m where Source #

All API calls to Elasticsearch operate within MonadBH . The idea is that it can be easily embedded in your own monad transformer stack. A default instance for a ReaderT and alias BH is provided for the simple case.

Minimal complete definition

getBHEnv

Methods

getBHEnv :: m BHEnv Source #

newtype MaybeNA a Source #

Constructors

MaybeNA 

Fields

Instances

Eq a => Eq (MaybeNA a) Source # 

Methods

(==) :: MaybeNA a -> MaybeNA a -> Bool #

(/=) :: MaybeNA a -> MaybeNA a -> Bool #

Show a => Show (MaybeNA a) Source # 

Methods

showsPrec :: Int -> MaybeNA a -> ShowS #

show :: MaybeNA a -> String #

showList :: [MaybeNA a] -> ShowS #

FromJSON a => FromJSON (MaybeNA a) Source # 

data Status Source #

Status is a data type for describing the JSON body returned by Elasticsearch when you query its status. This was deprecated in 1.2.0.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html#indices-status

Constructors

Status 

data UpdatableIndexSetting Source #

Constructors

NumberOfReplicas ReplicaCount

The number of replicas each shard has.

AutoExpandReplicas ReplicaBounds 
BlocksReadOnly Bool

Set to True to have the index read only. False to allow writes and metadata changes.

BlocksRead Bool

Set to True to disable read operations against the index.

BlocksWrite Bool

Set to True to disable write operations against the index.

BlocksMetaData Bool

Set to True to disable metadata operations against the index.

RefreshInterval NominalDiffTime

The async refresh interval of a shard

IndexConcurrency Int 
FailOnMergeFailure Bool 
TranslogFlushThresholdOps Int

When to flush on operations.

TranslogFlushThresholdSize Bytes

When to flush based on translog (bytes) size.

TranslogFlushThresholdPeriod NominalDiffTime

When to flush based on a period of not flushing.

TranslogDisableFlush Bool

Disables flushing. Note, should be set for a short interval and then enabled.

CacheFilterMaxSize (Maybe Bytes)

The maximum size of filter cache (per segment in shard).

CacheFilterExpire (Maybe NominalDiffTime)

The expire after access time for filter cache.

GatewaySnapshotInterval NominalDiffTime

The gateway snapshot interval (only applies to shared gateways).

RoutingAllocationInclude (NonEmpty NodeAttrFilter)

A node matching any rule will be allowed to host shards from the index.

RoutingAllocationExclude (NonEmpty NodeAttrFilter)

A node matching any rule will NOT be allowed to host shards from the index.

RoutingAllocationRequire (NonEmpty NodeAttrFilter)

Only nodes matching all rules will be allowed to host shards from the index.

RoutingAllocationEnable AllocationPolicy

Enables shard allocation for a specific index.

RoutingAllocationShardsPerNode ShardCount

Controls the total number of shards (replicas and primaries) allowed to be allocated on a single node.

RecoveryInitialShards InitialShardCount

When using local gateway a particular shard is recovered only if there can be allocated quorum shards in the cluster.

GCDeletes NominalDiffTime 
TTLDisablePurge Bool

Disables temporarily the purge of expired docs.

TranslogFSType FSType 
CompressionSetting Compression 
IndexCompoundFormat CompoundFormat 
IndexCompoundOnFlush Bool 
WarmerEnabled Bool 
MappingTotalFieldsLimit Int 
AnalysisSetting Analysis

Analysis is not a dynamic setting and can only be performed on a closed index.

data AllocationPolicy Source #

Constructors

AllocAll

Allows shard allocation for all shards.

AllocPrimaries

Allows shard allocation only for primary shards.

AllocNewPrimaries

Allows shard allocation only for primary shards for new indices.

AllocNone

No shard allocation is allowed

newtype Bytes Source #

A measure of bytes used for various configurations. You may want to use smart constructors like gigabytes for larger values.

>>> gigabytes 9
Bytes 9000000000
>>> megabytes 9
Bytes 9000000
>>> kilobytes 9
Bytes 9000

Constructors

Bytes Int 

data IndexTemplate Source #

An IndexTemplate defines a template that will automatically be applied to new indices created. The templates include both IndexSettings and mappings, and a simple TemplatePattern that controls if the template will be applied to the index created. Specify mappings as follows: [toJSON TweetMapping, ...]

https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-templates.html

newtype Server Source #

Server is used with the client functions to point at the ES instance

Constructors

Server Text 

type Reply = Response LByteString Source #

Reply and Method are type synonyms from Method

data EsResult a Source #

EsResult describes the standard wrapper JSON document that you see in successful Elasticsearch lookups or lookups that couldn't find the document.

Constructors

EsResult 

Instances

Eq a => Eq (EsResult a) Source # 

Methods

(==) :: EsResult a -> EsResult a -> Bool #

(/=) :: EsResult a -> EsResult a -> Bool #

Show a => Show (EsResult a) Source # 

Methods

showsPrec :: Int -> EsResult a -> ShowS #

show :: EsResult a -> String #

showList :: [EsResult a] -> ShowS #

FromJSON a => FromJSON (EsResult a) Source # 

data EsResultFound a Source #

EsResultFound contains the document and its metadata inside of an EsResult when the document was successfully found.

Constructors

EsResultFound 

Fields

data EsError Source #

EsError is the generic type that will be returned when there was a problem. If you can't parse the expected response, its a good idea to try parsing this.

Constructors

EsError 

data EsProtocolException Source #

EsProtocolException will be thrown if Bloodhound cannot parse a response returned by the Elasticsearch server. If you encounter this error, please verify that your domain data types and FromJSON instances are working properly (for example, the a of '[Hit a]' in 'SearchResult.searchHits.hits'). If you're sure that your mappings are correct, then this error may be an indication of an incompatibility between Bloodhound and Elasticsearch. Please open a bug report and be sure to include the exception body.

Constructors

EsProtocolException 

Fields

data DocVersion Source #

DocVersion is an integer version number for a document between 1 and 9.2e+18 used for .

newtype ExternalDocVersion Source #

ExternalDocVersion is a convenience wrapper if your code uses its own version numbers instead of ones from ES.

Instances

Bounded ExternalDocVersion Source # 
Enum ExternalDocVersion Source # 
Eq ExternalDocVersion Source # 
Ord ExternalDocVersion Source # 
Show ExternalDocVersion Source # 
ToJSON ExternalDocVersion Source # 

data VersionControl Source #

VersionControl is specified when indexing documents as a optimistic concurrency control.

Constructors

NoVersionControl

Don't send a version. This is a pure overwrite.

InternalVersion DocVersion

Use the default ES versioning scheme. Only index the document if the version is the same as the one specified. Only applicable to updates, as you should be getting Version from a search result.

ExternalGT ExternalDocVersion

Use your own version numbering. Only index the document if the version is strictly higher OR the document doesn't exist. The given version will be used as the new version number for the stored document. N.B. All updates must increment this number, meaning there is some global, external ordering of updates.

ExternalGTE ExternalDocVersion

Use your own version numbering. Only index the document if the version is equal or higher than the stored version. Will succeed if there is no existing document. The given version will be used as the new version number for the stored document. Use with care, as this could result in data loss.

ForceVersion ExternalDocVersion

The document will always be indexed and the given version will be the new version. This is typically used for correcting errors. Use with care, as this could result in data loss.

data IndexDocumentSettings Source #

IndexDocumentSettings are special settings supplied when indexing a document. For the best backwards compatiblity when new fields are added, you should probably prefer to start with defaultIndexDocumentSettings

data Query Source #

newtype From Source #

Constructors

From Int 

Instances

data Hit a Source #

Instances

Eq a => Eq (Hit a) Source # 

Methods

(==) :: Hit a -> Hit a -> Bool #

(/=) :: Hit a -> Hit a -> Bool #

Show a => Show (Hit a) Source # 

Methods

showsPrec :: Int -> Hit a -> ShowS #

show :: Hit a -> String #

showList :: [Hit a] -> ShowS #

FromJSON a => FromJSON (Hit a) Source # 

Methods

parseJSON :: Value -> Parser (Hit a) #

parseJSONList :: Value -> Parser [Hit a] #

newtype Filter Source #

As of Elastic 2.0, Filters are just Queries housed in a Bool Query, and flagged in a different context.

Constructors

Filter 

Fields

class Monoid a => Seminearring a where Source #

Minimal complete definition

(<||>)

Methods

(<||>) :: a -> a -> a infixr 5 Source #

(<&&>) :: a -> a -> a infixr 5 Source #

newtype FieldName Source #

FieldName is used all over the place wherever a specific field within a document needs to be specified, usually in Querys or Filters.

Constructors

FieldName Text 

data IndexSelection Source #

IndexSelection is used for APIs which take a single index, a list of indexes, or the special _all index.

data NodeSelection Source #

NodeSelection is used for most cluster APIs. See here for more details.

Constructors

LocalNode

Whatever node receives this request

NodeList (NonEmpty NodeSelector) 
AllNodes 

data NodeSelector Source #

An exact match or pattern to identify a node. Note that All of these options support wildcarding, so your node name, server, attr name can all contain * characters to be a fuzzy match.

Constructors

NodeByName NodeName 
NodeByFullNodeId FullNodeId 
NodeByHost Server

e.g. 10.0.0.1 or even 10.0.0.*

NodeByAttribute NodeAttrName Text

NodeAttrName can be a pattern, e.g. rack*. The value can too.

data ForceMergeIndexSettings Source #

Constructors

ForceMergeIndexSettings 

Fields

  • maxNumSegments :: Maybe Int

    Number of segments to optimize to. 1 will fully optimize the index. If omitted, the default behavior is to only optimize if the server deems it necessary.

  • onlyExpungeDeletes :: Bool

    Should the optimize process only expunge segments with deletes in them? If the purpose of the optimization is to free disk space, this should be set to True.

  • flushAfterOptimize :: Bool

    Should a flush be performed after the optimize.

defaultForceMergeIndexSettings :: ForceMergeIndexSettings Source #

defaultForceMergeIndexSettings implements the default settings that Elasticsearch uses for index optimization. maxNumSegments is Nothing, onlyExpungeDeletes is False, and flushAfterOptimize is True.

newtype DocId Source #

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.

Constructors

DocId Text 

data BulkOperation Source #

BulkOperation is a sum type for expressing the four kinds of bulk operation index, create, delete, and update. BulkIndex behaves like an "upsert", BulkCreate will fail if a document already exists at the DocId. Consult the Bulk API documentation for further explanation. Warning: Bulk operations suffixed with Auto rely on Elasticsearch to generate the id. Often, people use auto-generated identifiers when Elasticsearch is the only place that their data is stored. Do not let Elasticsearch be the only place your data is stored. It does not guarantee durability, and it may silently discard data. This issue is discussed further on github.

Constructors

BulkIndex IndexName MappingName DocId Value

Create the document, replacing it if it already exists.

BulkIndexAuto IndexName MappingName Value

Create a document with an autogenerated id.

BulkIndexEncodingAuto IndexName MappingName Encoding

Create a document with an autogenerated id. Use fast JSON encoding.

BulkCreate IndexName MappingName DocId Value

Create a document, failing if it already exists.

BulkCreateEncoding IndexName MappingName DocId Encoding

Create a document, failing if it already exists. Use fast JSON encoding.

BulkDelete IndexName MappingName DocId

Delete the document

BulkUpdate IndexName MappingName DocId Value

Update the document, merging the new value with the existing one.

type Sort = [SortSpec] Source #

Sort is a synonym for a list of SortSpecs. Sort behavior is order dependent with later sorts acting as tie-breakers for earlier sorts.

data DefaultSort Source #

DefaultSort is usually the kind of SortSpec you'll want. There's a mkSort convenience function for when you want to specify only the most common parameters.

The ignoreUnmapped, when Just field is used to set the elastic unmapped_type

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#search-request-sort

data Missing Source #

Missing prescribes how to handle missing fields. A missing field can be sorted last, first, or using a custom value as a substitute.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-sort.html#_missing_values

data MoreLikeThisFieldQuery Source #

data QueryStringQuery Source #

newtype Lenient Source #

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.

Constructors

Lenient Bool 

newtype MinimumMatch Source #

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.

Constructors

MinimumMatch Int 

type Cache = Bool Source #

Cache is for telling ES whether it should cache a Filter not. Querys cannot be cached.

data Mapping Source #

Support for type reification of Mappings is currently incomplete, for now the mapping API verbiage expects a ToJSONable blob.

Indexes have mappings, mappings are schemas for the documents contained in the index. I'd recommend having only one mapping per index, always having a mapping, and keeping different kinds of documents separated if possible.

Constructors

Mapping 

newtype Locale Source #

Locale is used for string conversions - defaults to ROOT.

Constructors

Locale Text 

class Monoid a where #

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

  • mappend mempty x = x
  • mappend x mempty = x
  • mappend x (mappend y z) = mappend (mappend x y) z
  • mconcat = foldr mappend mempty

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.

Minimal complete definition

mempty, mappend

Methods

mempty :: a #

Identity of mappend

mappend :: a -> a -> a #

An associative operation

mconcat :: [a] -> a #

Fold a list using the monoid. For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

Instances

Monoid Ordering

Since: 2.1

Monoid ()

Since: 2.1

Methods

mempty :: () #

mappend :: () -> () -> () #

mconcat :: [()] -> () #

Monoid ByteString 
Monoid ByteString 
Monoid Builder 
Monoid Series 
Monoid More 

Methods

mempty :: More #

mappend :: More -> More -> More #

mconcat :: [More] -> More #

Monoid All

Since: 2.1

Methods

mempty :: All #

mappend :: All -> All -> All #

mconcat :: [All] -> All #

Monoid Any

Since: 2.1

Methods

mempty :: Any #

mappend :: Any -> Any -> Any #

mconcat :: [Any] -> Any #

Monoid String 
Monoid ShortByteString 
Monoid IntSet 
Monoid CookieJar

Since 1.9

Monoid RequestBody 
Monoid Filter # 
Monoid [a]

Since: 2.1

Methods

mempty :: [a] #

mappend :: [a] -> [a] -> [a] #

mconcat :: [[a]] -> [a] #

Monoid a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S." Since there used to be no "Semigroup" typeclass providing just mappend, we use Monoid instead.

Since: 2.1

Methods

mempty :: Maybe a #

mappend :: Maybe a -> Maybe a -> Maybe a #

mconcat :: [Maybe a] -> Maybe a #

Monoid a => Monoid (IO a)

Since: 4.9.0.0

Methods

mempty :: IO a #

mappend :: IO a -> IO a -> IO a #

mconcat :: [IO a] -> IO a #

Monoid (IResult a) 

Methods

mempty :: IResult a #

mappend :: IResult a -> IResult a -> IResult a #

mconcat :: [IResult a] -> IResult a #

Monoid (Result a) 

Methods

mempty :: Result a #

mappend :: Result a -> Result a -> Result a #

mconcat :: [Result a] -> Result a #

Monoid (Parser a) 

Methods

mempty :: Parser a #

mappend :: Parser a -> Parser a -> Parser a #

mconcat :: [Parser a] -> Parser a #

(Ord a, Bounded a) => Monoid (Min a)

Since: 4.9.0.0

Methods

mempty :: Min a #

mappend :: Min a -> Min a -> Min a #

mconcat :: [Min a] -> Min a #

(Ord a, Bounded a) => Monoid (Max a)

Since: 4.9.0.0

Methods

mempty :: Max a #

mappend :: Max a -> Max a -> Max a #

mconcat :: [Max a] -> Max a #

Monoid m => Monoid (WrappedMonoid m)

Since: 4.9.0.0

Semigroup a => Monoid (Option a)

Since: 4.9.0.0

Methods

mempty :: Option a #

mappend :: Option a -> Option a -> Option a #

mconcat :: [Option a] -> Option a #

Monoid a => Monoid (Identity a) 

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

Monoid a => Monoid (Dual a)

Since: 2.1

Methods

mempty :: Dual a #

mappend :: Dual a -> Dual a -> Dual a #

mconcat :: [Dual a] -> Dual a #

Monoid (Endo a)

Since: 2.1

Methods

mempty :: Endo a #

mappend :: Endo a -> Endo a -> Endo a #

mconcat :: [Endo a] -> Endo a #

Num a => Monoid (Sum a)

Since: 2.1

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

Num a => Monoid (Product a)

Since: 2.1

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

mconcat :: [Product a] -> Product a #

Monoid (First a)

Since: 2.1

Methods

mempty :: First a #

mappend :: First a -> First a -> First a #

mconcat :: [First a] -> First a #

Monoid (Last a)

Since: 2.1

Methods

mempty :: Last a #

mappend :: Last a -> Last a -> Last a #

mconcat :: [Last a] -> Last a #

PrimType ty => Monoid (UArray ty) 

Methods

mempty :: UArray ty #

mappend :: UArray ty -> UArray ty -> UArray ty #

mconcat :: [UArray ty] -> UArray ty #

PrimType ty => Monoid (Block ty) 

Methods

mempty :: Block ty #

mappend :: Block ty -> Block ty -> Block ty #

mconcat :: [Block ty] -> Block ty #

Monoid (CountOf ty) 

Methods

mempty :: CountOf ty #

mappend :: CountOf ty -> CountOf ty -> CountOf ty #

mconcat :: [CountOf ty] -> CountOf ty #

Monoid s => Monoid (CI s) 

Methods

mempty :: CI s #

mappend :: CI s -> CI s -> CI s #

mconcat :: [CI s] -> CI s #

Monoid (IntMap a) 

Methods

mempty :: IntMap a #

mappend :: IntMap a -> IntMap a -> IntMap a #

mconcat :: [IntMap a] -> IntMap a #

Monoid (Seq a) 

Methods

mempty :: Seq a #

mappend :: Seq a -> Seq a -> Seq a #

mconcat :: [Seq a] -> Seq a #

Ord a => Monoid (Set a) 

Methods

mempty :: Set a #

mappend :: Set a -> Set a -> Set a #

mconcat :: [Set a] -> Set a #

Monoid (DList a) 

Methods

mempty :: DList a #

mappend :: DList a -> DList a -> DList a #

mconcat :: [DList a] -> DList a #

Monoid (Array a) 

Methods

mempty :: Array a #

mappend :: Array a -> Array a -> Array a #

mconcat :: [Array a] -> Array a #

(Hashable a, Eq a) => Monoid (HashSet a) 

Methods

mempty :: HashSet a #

mappend :: HashSet a -> HashSet a -> HashSet a #

mconcat :: [HashSet a] -> HashSet a #

Storable a => Monoid (Vector a) 

Methods

mempty :: Vector a #

mappend :: Vector a -> Vector a -> Vector a #

mconcat :: [Vector a] -> Vector a #

Prim a => Monoid (Vector a) 

Methods

mempty :: Vector a #

mappend :: Vector a -> Vector a -> Vector a #

mconcat :: [Vector a] -> Vector a #

Monoid (Vector a) 

Methods

mempty :: Vector a #

mappend :: Vector a -> Vector a -> Vector a #

mconcat :: [Vector a] -> Vector a #

Monoid (SearchHits a) # 
Monoid (SearchHits a) # 
Monoid b => Monoid (a -> b)

Since: 2.1

Methods

mempty :: a -> b #

mappend :: (a -> b) -> (a -> b) -> a -> b #

mconcat :: [a -> b] -> a -> b #

(Monoid a, Monoid b) => Monoid (a, b)

Since: 2.1

Methods

mempty :: (a, b) #

mappend :: (a, b) -> (a, b) -> (a, b) #

mconcat :: [(a, b)] -> (a, b) #

(Eq k, Hashable k) => Monoid (HashMap k v) 

Methods

mempty :: HashMap k v #

mappend :: HashMap k v -> HashMap k v -> HashMap k v #

mconcat :: [HashMap k v] -> HashMap k v #

Ord k => Monoid (Map k v) 

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

mconcat :: [Map k v] -> Map k v #

Monoid (Parser i a) 

Methods

mempty :: Parser i a #

mappend :: Parser i a -> Parser i a -> Parser i a #

mconcat :: [Parser i a] -> Parser i a #

Monoid (Proxy k s)

Since: 4.7.0.0

Methods

mempty :: Proxy k s #

mappend :: Proxy k s -> Proxy k s -> Proxy k s #

mconcat :: [Proxy k s] -> Proxy k s #

(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)

Since: 2.1

Methods

mempty :: (a, b, c) #

mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) #

mconcat :: [(a, b, c)] -> (a, b, c) #

Monoid a => Monoid (Const k a b) 

Methods

mempty :: Const k a b #

mappend :: Const k a b -> Const k a b -> Const k a b #

mconcat :: [Const k a b] -> Const k a b #

Alternative f => Monoid (Alt * f a)

Since: 4.8.0.0

Methods

mempty :: Alt * f a #

mappend :: Alt * f a -> Alt * f a -> Alt * f a #

mconcat :: [Alt * f a] -> Alt * f a #

(Semigroup a, Monoid a) => Monoid (Tagged k s a) 

Methods

mempty :: Tagged k s a #

mappend :: Tagged k s a -> Tagged k s a -> Tagged k s a #

mconcat :: [Tagged k s a] -> Tagged k s a #

(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)

Since: 2.1

Methods

mempty :: (a, b, c, d) #

mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

mconcat :: [(a, b, c, d)] -> (a, b, c, d) #

(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)

Since: 2.1

Methods

mempty :: (a, b, c, d, e) #

mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) #

class ToJSON a where #

A type that can be converted to JSON.

Instances in general must specify toJSON and should (but don't need to) specify toEncoding.

An example type and instance:

-- Allow ourselves to write Text literals.
{-# LANGUAGE OverloadedStrings #-}

data Coord = Coord { x :: Double, y :: Double }

instance ToJSON Coord where
  toJSON (Coord x y) = object ["x" .= x, "y" .= y]

  toEncoding (Coord x y) = pairs ("x" .= x <> "y" .= y)

Instead of manually writing your ToJSON instance, there are two options to do it automatically:

  • Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so it will probably be more efficient than the following option.
  • The compiler can provide a default generic implementation for toJSON.

To use the second, simply add a deriving Generic clause to your datatype and declare a ToJSON instance. If you require nothing other than defaultOptions, it is sufficient to write (and this is the only alternative where the default toJSON implementation is sufficient):

{-# LANGUAGE DeriveGeneric #-}

import GHC.Generics

data Coord = Coord { x :: Double, y :: Double } deriving Generic

instance ToJSON Coord where
    toEncoding = genericToEncoding defaultOptions

If on the other hand you wish to customize the generic decoding, you have to implement both methods:

customOptions = defaultOptions
                { fieldLabelModifier = map toUpper
                }

instance ToJSON Coord where
    toJSON     = genericToJSON customOptions
    toEncoding = genericToEncoding customOptions

Previous versions of this library only had the toJSON method. Adding toEncoding had to reasons:

  1. toEncoding is more efficient for the common case that the output of toJSON is directly serialized to a ByteString. Further, expressing either method in terms of the other would be non-optimal.
  2. The choice of defaults allows a smooth transition for existing users: Existing instances that do not define toEncoding still compile and have the correct semantics. This is ensured by making the default implementation of toEncoding use toJSON. This produces correct results, but since it performs an intermediate conversion to a Value, it will be less efficient than directly emitting an Encoding. (this also means that specifying nothing more than instance ToJSON Coord would be sufficient as a generically decoding instance, but there probably exists no good reason to not specify toEncoding in new instances.)

Methods

toJSON :: a -> Value #

Convert a Haskell value to a JSON-friendly intermediate type.

toEncoding :: a -> Encoding #

Encode a Haskell value as JSON.

The default implementation of this method creates an intermediate Value using toJSON. This provides source-level compatibility for people upgrading from older versions of this library, but obviously offers no performance advantage.

To benefit from direct encoding, you must provide an implementation for this method. The easiest way to do so is by having your types implement Generic using the DeriveGeneric extension, and then have GHC generate a method body as follows.

instance ToJSON Coord where
    toEncoding = genericToEncoding defaultOptions

toJSONList :: [a] -> Value #

toEncodingList :: [a] -> Encoding #

Instances

ToJSON Bool 
ToJSON Char 
ToJSON Double 
ToJSON Float 
ToJSON Int 
ToJSON Int8 
ToJSON Int16 
ToJSON Int32 
ToJSON Int64 
ToJSON Integer 
ToJSON Natural 
ToJSON Ordering 
ToJSON Word 
ToJSON Word8 
ToJSON Word16 
ToJSON Word32 
ToJSON Word64 
ToJSON () 

Methods

toJSON :: () -> Value #

toEncoding :: () -> Encoding #

toJSONList :: [()] -> Value #

toEncodingList :: [()] -> Encoding #

ToJSON Scientific 
ToJSON Number 
ToJSON Text 
ToJSON UTCTime 
ToJSON Value 
ToJSON DotNetTime 
ToJSON Text 
ToJSON Version 
ToJSON CTime 
ToJSON IntSet 
ToJSON DiffTime 
ToJSON ZonedTime 
ToJSON LocalTime 
ToJSON TimeOfDay 
ToJSON NominalDiffTime 
ToJSON Day 
ToJSON UUID 
ToJSON SnapshotName # 
ToJSON IndexAliasName # 
ToJSON IndexName # 
ToJSON MaxDocFrequency # 
ToJSON MinDocFrequency # 
ToJSON PhraseSlop # 
ToJSON MinWordLength # 
ToJSON MaxWordLength # 
ToJSON Locale # 
ToJSON GeneratePhraseQueries # 
ToJSON AnalyzeWildcard # 
ToJSON EnablePositionIncrements # 
ToJSON LowercaseExpanded # 
ToJSON AllowLeadingWildcard # 
ToJSON QueryPath # 
ToJSON StopWord # 
ToJSON PercentMatch # 
ToJSON TypeName # 
ToJSON PrefixLength # 
ToJSON Fuzziness # 
ToJSON MaxQueryTerms # 
ToJSON MinimumTermFrequency # 
ToJSON IgnoreTermFrequency # 
ToJSON DisableCoord # 
ToJSON MinimumMatch # 
ToJSON Tiebreaker # 
ToJSON Lenient # 
ToJSON MaxExpansions # 
ToJSON Analyzer # 
ToJSON CutoffFrequency # 
ToJSON NullValue # 
ToJSON Existence # 
ToJSON CacheKey # 
ToJSON CacheName # 
ToJSON QueryString # 
ToJSON DocId # 
ToJSON MappingName # 
ToJSON TemplatePattern # 
ToJSON TemplateName # 
ToJSON ShardCount # 
ToJSON ReplicaCount # 
ToJSON BoostTerms # 
ToJSON Boost # 
ToJSON FieldName # 
ToJSON Size # 
ToJSON From # 
ToJSON ZeroTermsQuery # 
ToJSON RangeExecution # 
ToJSON RegexpFlags # 
ToJSON TemplateQueryKeyValuePairs # 
ToJSON BooleanOperator # 
ToJSON TemplateQueryInline # 
ToJSON CommonMinimumMatch # 
ToJSON CommonTermsQuery # 
ToJSON BoostingQuery # 
ToJSON BoolQuery # 
ToJSON MultiMatchQueryType # 
ToJSON MultiMatchQuery # 
ToJSON MatchQueryType # 
ToJSON MatchQuery # 
ToJSON DisMaxQuery # 
ToJSON FilteredQuery # 
ToJSON FuzzyLikeThisQuery # 
ToJSON FuzzyLikeFieldQuery # 
ToJSON FuzzyQuery # 
ToJSON ScoreType # 
ToJSON HasChildQuery # 
ToJSON HasParentQuery # 
ToJSON IndicesQuery # 
ToJSON MoreLikeThisQuery # 
ToJSON MoreLikeThisFieldQuery # 
ToJSON NestedQuery # 
ToJSON PrefixQuery # 
ToJSON FieldOrFields # 
ToJSON QueryStringQuery # 
ToJSON SimpleQueryFlag # 
ToJSON SimpleQueryStringQuery # 
ToJSON RangeQuery # 
ToJSON RegexpQuery # 
ToJSON Query # 
ToJSON GeoBoundingBox # 
ToJSON DistanceType # 
ToJSON GeoBoundingBoxConstraint # 
ToJSON GeoFilterType # 
ToJSON Distance # 
ToJSON OptimizeBbox # 
ToJSON Term # 
ToJSON BoolMatch # 
ToJSON Filter # 
ToJSON DistanceUnit # 
ToJSON LatLon # 
ToJSON GeoPoint # 
ToJSON DirectGeneratorSuggestModeTypes # 
ToJSON DirectGenerators # 
ToJSON PhraseSuggesterCollate # 
ToJSON PhraseSuggesterHighlighter # 
ToJSON PhraseSuggester # 
ToJSON SuggestType # 
ToJSON Suggest # 
ToJSON Missing # 
ToJSON SortMode # 
ToJSON SortOrder # 
ToJSON SortSpec # 
ToJSON HighlightEncoder # 
ToJSON FieldHighlight # 
ToJSON HighlightSettings # 
ToJSON Highlights # 
ToJSON ScrollId # 
ToJSON Pattern # 
ToJSON Exclude # 
ToJSON Include # 
ToJSON PatternOrPatterns # 
ToJSON Source # 
ToJSON RestoreIndexSettings # 
ToJSON RestoreRenamePattern # 
ToJSON GenericSnapshotRepoSettings # 
ToJSON SnapshotRepoType # 
ToJSON SnapshotRepoName # 
ToJSON ExternalDocVersion # 
ToJSON RoutingValue # 
ToJSON IndexAliasRouting # 
ToJSON SearchAliasRouting # 
ToJSON AliasRouting # 
ToJSON IndexAliasCreate # 
ToJSON IndexAliasAction # 
ToJSON DocVersion # 
ToJSON IndexAlias # 
ToJSON IndexTemplate # 
ToJSON NominalDiffTimeJSON # 
ToJSON CompoundFormat # 
ToJSON FSType # 
ToJSON InitialShardCount # 
ToJSON BuildHash # 
ToJSON Interval # 
ToJSON Bytes # 
ToJSON ReplicaBounds # 
ToJSON AllocationPolicy # 
ToJSON UpdatableIndexSetting # 
ToJSON IndexSettings # 
ToJSON VersionNumber # 
ToJSON Version # 
ToJSON CollectionMode # 
ToJSON DateMathExpr # 
ToJSON ExecutionHint # 
ToJSON TermOrder # 
ToJSON TermInclusion # 
ToJSON DateRangeAggRange # 
ToJSON DateRangeAggregation # 
ToJSON Aggregation # 
ToJSON Search # 
ToJSON CharFilter # 
ToJSON TokenFilter # 
ToJSON SnapshotName # 
ToJSON IndexAliasName # 
ToJSON IndexName # 
ToJSON ShardCount # 
ToJSON ReplicaCount # 
ToJSON BoostTerms # 
ToJSON Boost # 
ToJSON MaxDocFrequency # 
ToJSON MinDocFrequency # 
ToJSON PhraseSlop # 
ToJSON MinWordLength # 
ToJSON MaxWordLength # 
ToJSON Locale # 
ToJSON GeneratePhraseQueries # 
ToJSON AnalyzeWildcard # 
ToJSON EnablePositionIncrements # 
ToJSON LowercaseExpanded # 
ToJSON AllowLeadingWildcard # 
ToJSON QueryPath # 
ToJSON StopWord # 
ToJSON PercentMatch # 
ToJSON PrefixLength # 
ToJSON Fuzziness # 
ToJSON MaxQueryTerms # 
ToJSON MinimumTermFrequency # 
ToJSON IgnoreTermFrequency # 
ToJSON DisableCoord # 
ToJSON MinimumMatch # 
ToJSON Tiebreaker # 
ToJSON Lenient # 
ToJSON MaxExpansions # 
ToJSON Analyzer # 
ToJSON CutoffFrequency # 
ToJSON NullValue # 
ToJSON Existence # 
ToJSON CacheKey # 
ToJSON CacheName # 
ToJSON QueryString # 
ToJSON TypeName # 
ToJSON FieldName # 
ToJSON DocId # 
ToJSON MappingName # 
ToJSON Size # 
ToJSON From # 
ToJSON FactorMissingFieldValue # 
ToJSON FactorModifier # 
ToJSON Factor # 
ToJSON FieldValueFactor # 
ToJSON Seed # 
ToJSON Weight # 
ToJSON ScoreMode # 
ToJSON BoostMode # 
ToJSON ScriptParams # 
ToJSON ScriptId # 
ToJSON ScriptInline # 
ToJSON ScriptLanguage # 
ToJSON Script # 
ToJSON ScriptFields # 
ToJSON ComponentFunctionScoreFunction # 
ToJSON FunctionScoreQuery # 
ToJSON BooleanOperator # 
ToJSON TemplateQueryInline # 
ToJSON TemplateQueryKeyValuePairs # 
ToJSON Distance # 
ToJSON OptimizeBbox # 
ToJSON DistanceType # 
ToJSON DistanceUnit # 
ToJSON GeoPoint # 
ToJSON GeoBoundingBoxConstraint # 
ToJSON GeoBoundingBox # 
ToJSON LatLon # 
ToJSON GeoFilterType # 
ToJSON BoolMatch # 
ToJSON Term # 
ToJSON RegexpFlags # 
ToJSON RangeExecution # 
ToJSON ZeroTermsQuery # 
ToJSON CommonMinimumMatch # 
ToJSON CommonTermsQuery # 
ToJSON BoostingQuery # 
ToJSON BoolQuery # 
ToJSON MultiMatchQueryType # 
ToJSON MultiMatchQuery # 
ToJSON MatchQueryType # 
ToJSON MatchQuery # 
ToJSON DisMaxQuery # 
ToJSON FuzzyLikeThisQuery # 
ToJSON FuzzyLikeFieldQuery # 
ToJSON FuzzyQuery # 
ToJSON ScoreType # 
ToJSON HasChildQuery # 
ToJSON HasParentQuery # 
ToJSON IndicesQuery # 
ToJSON MoreLikeThisQuery # 
ToJSON MoreLikeThisFieldQuery # 
ToJSON NestedQuery # 
ToJSON PrefixQuery # 
ToJSON FieldOrFields # 
ToJSON QueryStringQuery # 
ToJSON SimpleQueryFlag # 
ToJSON SimpleQueryStringQuery # 
ToJSON RangeQuery # 
ToJSON WildcardQuery # 
ToJSON RegexpQuery # 
ToJSON Filter # 
ToJSON Query # 
ToJSON HighlightEncoder # 
ToJSON HighlightSettings # 
ToJSON FieldHighlight # 
ToJSON Highlights # 
ToJSON Missing # 
ToJSON SortOrder # 
ToJSON SortSpec # 
ToJSON SortMode # 
ToJSON Language # 
ToJSON TokenFilterDefinition # 
ToJSON TokenChar # 
ToJSON TokenizerDefinition # 
ToJSON CharFilterDefinition # 
ToJSON AnalyzerDefinition # 
ToJSON Tokenizer # 
ToJSON Analysis # 
ToJSON Interval # 
ToJSON RestoreIndexSettings # 
ToJSON RestoreRenamePattern # 
ToJSON VMVersion # 
ToJSON BuildHash # 
ToJSON GenericSnapshotRepoSettings # 
ToJSON SnapshotRepoType # 
ToJSON SnapshotRepoName # 
ToJSON TemplatePattern # 
ToJSON TemplateName # 
ToJSON ExternalDocVersion # 
ToJSON DocVersion # 
ToJSON RoutingValue # 
ToJSON IndexAliasRouting # 
ToJSON SearchAliasRouting # 
ToJSON AliasRouting # 
ToJSON IndexAliasCreate # 
ToJSON IndexAliasAction # 
ToJSON IndexAlias # 
ToJSON AllocationPolicy # 
ToJSON IndexTemplate # 
ToJSON NominalDiffTimeJSON # 
ToJSON CompoundFormat # 
ToJSON InitialShardCount # 
ToJSON FSType # 
ToJSON Bytes # 
ToJSON Compression # 
ToJSON ReplicaBounds # 
ToJSON UpdatableIndexSetting # 
ToJSON IndexSettings # 
ToJSON VersionNumber # 
ToJSON Version # 
ToJSON DateMathExpr # 
ToJSON ExecutionHint # 
ToJSON CollectionMode # 
ToJSON TermOrder # 
ToJSON TermInclusion # 
ToJSON DateRangeAggRange # 
ToJSON DateRangeAggregation # 
ToJSON Aggregation # 
ToJSON DirectGenerators # 
ToJSON DirectGeneratorSuggestModeTypes # 
ToJSON PhraseSuggesterCollate # 
ToJSON PhraseSuggesterHighlighter # 
ToJSON PhraseSuggester # 
ToJSON SuggestType # 
ToJSON Suggest # 
ToJSON ScrollId # 
ToJSON Pattern # 
ToJSON Exclude # 
ToJSON Include # 
ToJSON PatternOrPatterns # 
ToJSON Source # 
ToJSON Search # 
ToJSON a => ToJSON [a] 

Methods

toJSON :: [a] -> Value #

toEncoding :: [a] -> Encoding #

toJSONList :: [[a]] -> Value #

toEncodingList :: [[a]] -> Encoding #

ToJSON a => ToJSON (Maybe a) 
(ToJSON a, Integral a) => ToJSON (Ratio a) 
HasResolution a => ToJSON (Fixed a) 
ToJSON a => ToJSON (Min a) 

Methods

toJSON :: Min a -> Value #

toEncoding :: Min a -> Encoding #

toJSONList :: [Min a] -> Value #

toEncodingList :: [Min a] -> Encoding #

ToJSON a => ToJSON (Max a) 

Methods

toJSON :: Max a -> Value #

toEncoding :: Max a -> Encoding #

toJSONList :: [Max a] -> Value #

toEncodingList :: [Max a] -> Encoding #

ToJSON a => ToJSON (First a) 
ToJSON a => ToJSON (Last a) 
ToJSON a => ToJSON (WrappedMonoid a) 
ToJSON a => ToJSON (Option a) 
ToJSON a => ToJSON (NonEmpty a) 
ToJSON a => ToJSON (Identity a) 
ToJSON a => ToJSON (Dual a) 
ToJSON a => ToJSON (First a) 
ToJSON a => ToJSON (Last a) 
ToJSON a => ToJSON (IntMap a) 
ToJSON v => ToJSON (Tree v) 
ToJSON a => ToJSON (Seq a) 

Methods

toJSON :: Seq a -> Value #

toEncoding :: Seq a -> Encoding #

toJSONList :: [Seq a] -> Value #

toEncodingList :: [Seq a] -> Encoding #

ToJSON a => ToJSON (Set a) 

Methods

toJSON :: Set a -> Value #

toEncoding :: Set a -> Encoding #

toJSONList :: [Set a] -> Value #

toEncodingList :: [Set a] -> Encoding #

ToJSON a => ToJSON (DList a) 
ToJSON a => ToJSON (HashSet a) 
(Vector Vector a, ToJSON a) => ToJSON (Vector a) 
(Storable a, ToJSON a) => ToJSON (Vector a) 
(Prim a, ToJSON a) => ToJSON (Vector a) 
ToJSON a => ToJSON (Vector a) 
(ToJSON a, ToJSON b) => ToJSON (Either a b) 

Methods

toJSON :: Either a b -> Value #

toEncoding :: Either a b -> Encoding #

toJSONList :: [Either a b] -> Value #

toEncodingList :: [Either a b] -> Encoding #

(ToJSON a, ToJSON b) => ToJSON (a, b) 

Methods

toJSON :: (a, b) -> Value #

toEncoding :: (a, b) -> Encoding #

toJSONList :: [(a, b)] -> Value #

toEncodingList :: [(a, b)] -> Encoding #

(ToJSON v, ToJSONKey k) => ToJSON (HashMap k v) 
(ToJSON v, ToJSONKey k) => ToJSON (Map k v) 

Methods

toJSON :: Map k v -> Value #

toEncoding :: Map k v -> Encoding #

toJSONList :: [Map k v] -> Value #

toEncodingList :: [Map k v] -> Encoding #

ToJSON (Proxy k a) 

Methods

toJSON :: Proxy k a -> Value #

toEncoding :: Proxy k a -> Encoding #

toJSONList :: [Proxy k a] -> Value #

toEncodingList :: [Proxy k a] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c) => ToJSON (a, b, c) 

Methods

toJSON :: (a, b, c) -> Value #

toEncoding :: (a, b, c) -> Encoding #

toJSONList :: [(a, b, c)] -> Value #

toEncodingList :: [(a, b, c)] -> Encoding #

ToJSON a => ToJSON (Const k a b) 

Methods

toJSON :: Const k a b -> Value #

toEncoding :: Const k a b -> Encoding #

toJSONList :: [Const k a b] -> Value #

toEncodingList :: [Const k a b] -> Encoding #

ToJSON b => ToJSON (Tagged k a b) 

Methods

toJSON :: Tagged k a b -> Value #

toEncoding :: Tagged k a b -> Encoding #

toJSONList :: [Tagged k a b] -> Value #

toEncodingList :: [Tagged k a b] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON (a, b, c, d) 

Methods

toJSON :: (a, b, c, d) -> Value #

toEncoding :: (a, b, c, d) -> Encoding #

toJSONList :: [(a, b, c, d)] -> Value #

toEncodingList :: [(a, b, c, d)] -> Encoding #

(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Product * f g a) 

Methods

toJSON :: Product * f g a -> Value #

toEncoding :: Product * f g a -> Encoding #

toJSONList :: [Product * f g a] -> Value #

toEncodingList :: [Product * f g a] -> Encoding #

(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Sum * f g a) 

Methods

toJSON :: Sum * f g a -> Value #

toEncoding :: Sum * f g a -> Encoding #

toJSONList :: [Sum * f g a] -> Value #

toEncodingList :: [Sum * f g a] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON (a, b, c, d, e) 

Methods

toJSON :: (a, b, c, d, e) -> Value #

toEncoding :: (a, b, c, d, e) -> Encoding #

toJSONList :: [(a, b, c, d, e)] -> Value #

toEncodingList :: [(a, b, c, d, e)] -> Encoding #

(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Compose * * f g a) 

Methods

toJSON :: Compose * * f g a -> Value #

toEncoding :: Compose * * f g a -> Encoding #

toJSONList :: [Compose * * f g a] -> Value #

toEncodingList :: [Compose * * f g a] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON (a, b, c, d, e, f) 

Methods

toJSON :: (a, b, c, d, e, f) -> Value #

toEncoding :: (a, b, c, d, e, f) -> Encoding #

toJSONList :: [(a, b, c, d, e, f)] -> Value #

toEncodingList :: [(a, b, c, d, e, f)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g) => ToJSON (a, b, c, d, e, f, g) 

Methods

toJSON :: (a, b, c, d, e, f, g) -> Value #

toEncoding :: (a, b, c, d, e, f, g) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h) => ToJSON (a, b, c, d, e, f, g, h) 

Methods

toJSON :: (a, b, c, d, e, f, g, h) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i) => ToJSON (a, b, c, d, e, f, g, h, i) 

Methods

toJSON :: (a, b, c, d, e, f, g, h, i) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h, i) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h, i)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h, i)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j) => ToJSON (a, b, c, d, e, f, g, h, i, j) 

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h, i, j) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h, i, j)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h, i, j)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k) => ToJSON (a, b, c, d, e, f, g, h, i, j, k) 

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h, i, j, k) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m) 

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> Encoding #

(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n, ToJSON o) => ToJSON (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

Methods

toJSON :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Value #

toEncoding :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Encoding #

toJSONList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> Value #

toEncodingList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> Encoding #

data GenericSnapshotRepo Source #

A generic representation of a snapshot repo. This is what gets sent to and parsed from the server. For repo types enabled by plugins that aren't exported by this library, consider making a custom type which implements SnapshotRepo. If it is a common repo type, consider submitting a pull request to have it included in the library proper

newtype SnapshotRepoUpdateSettings Source #

Constructors

SnapshotRepoUpdateSettings 

Fields

  • repoUpdateVerify :: Bool

    After creation/update, synchronously check that nodes can write to this repo. Defaults to True. You may use False if you need a faster response and plan on verifying manually later with verifySnapshotRepo.

defaultSnapshotRepoUpdateSettings :: SnapshotRepoUpdateSettings Source #

Reasonable defaults for repo creation/update

  • repoUpdateVerify True

data SnapshotRepoPattern Source #

Either specifies an exact repo name or one with globs in it, e.g. RepoPattern "foo*" NOTE: Patterns are not supported on ES < 1.7

newtype FullNodeId Source #

Unique, automatically-generated name assigned to nodes that are usually returned in node-oriented APIs.

Constructors

FullNodeId 

Fields

newtype NodeName Source #

A human-readable node name that is supplied by the user in the node config or automatically generated by Elasticsearch.

Constructors

NodeName 

Fields

data NodeThreadPoolsStats Source #

data NodeIndicesStats Source #

Constructors

NodeIndicesStats 

Fields

newtype EsAddress Source #

A quirky address format used throughout Elasticsearch. An example would be inet[/1.1.1.1:9200]. inet may be a placeholder for a FQDN.

Constructors

EsAddress 

Fields

newtype PID Source #

Constructors

PID 

Fields

Instances

Eq PID Source # 

Methods

(==) :: PID -> PID -> Bool #

(/=) :: PID -> PID -> Bool #

Show PID Source # 

Methods

showsPrec :: Int -> PID -> ShowS #

show :: PID -> String #

showList :: [PID] -> ShowS #

FromJSON PID Source # 

data FsSnapshotRepo Source #

A filesystem-based snapshot repo that ships with Elasticsearch. This is an instance of SnapshotRepo so it can be used with updateSnapshotRepo

Constructors

FsSnapshotRepo 

Fields

data SnapshotCreateSettings Source #

Constructors

SnapshotCreateSettings 

Fields

  • snapWaitForCompletion :: Bool

    Should the API call return immediately after initializing the snapshot or wait until completed? Note that if this is enabled it could wait a long time, so you should adjust your ManagerSettings accordingly to set long timeouts or explicitly handle timeouts.

  • snapIndices :: Maybe IndexSelection

    Nothing will snapshot all indices. Just [] is permissable and will essentially be a no-op snapshot.

  • snapIgnoreUnavailable :: Bool

    If set to True, any matched indices that don't exist will be ignored. Otherwise it will be an error and fail.

  • snapIncludeGlobalState :: Bool
     
  • snapPartial :: Bool

    If some indices failed to snapshot (e.g. if not all primary shards are available), should the process proceed?

defaultSnapshotCreateSettings :: SnapshotCreateSettings Source #

Reasonable defaults for snapshot creation

  • snapWaitForCompletion False
  • snapIndices Nothing
  • snapIgnoreUnavailable False
  • snapIncludeGlobalState True
  • snapPartial False

data SnapshotPattern Source #

Either specifies an exact snapshot name or one with globs in it, e.g. SnapPattern "foo*" NOTE: Patterns are not supported on ES < 1.7

data SnapshotRestoreSettings Source #

Constructors

SnapshotRestoreSettings 

Fields

defaultSnapshotRestoreSettings :: SnapshotRestoreSettings Source #

Reasonable defaults for snapshot restores

  • snapRestoreWaitForCompletion False
  • snapRestoreIndices Nothing
  • snapRestoreIgnoreUnavailable False
  • snapRestoreIncludeGlobalState True
  • snapRestoreRenamePattern Nothing
  • snapRestoreRenameReplacement Nothing
  • snapRestorePartial False
  • snapRestoreIncludeAliases True
  • snapRestoreIndexSettingsOverrides Nothing
  • snapRestoreIgnoreIndexSettings Nothing

data RestoreRenameToken Source #

A single token in a index renaming scheme for a restore. These are concatenated into a string before being sent to Elasticsearch. Check out these Java docs to find out more if you're into that sort of thing.

Constructors

RRTLit Text

Just a literal string of characters

RRSubWholeMatch

Equivalent to $0. The entire matched pattern, not any subgroup

RRSubGroup RRGroupRefNum

A specific reference to a group number

mkRRGroupRefNum :: Int -> Maybe RRGroupRefNum Source #

Only allows valid group number references (1-9).

data Bucket a Source #

Constructors

Bucket 

Fields

data DateMathAnchor Source #

Starting point for a date range. This along with the DateMathModifiers gets you the date ES will start from.

Constructors

DMNow 
DMDate Day 

newtype EsUsername Source #

Username type used for HTTP Basic authentication. See basicAuthHook.

Constructors

EsUsername 

Fields

newtype EsPassword Source #

Password type used for HTTP Basic authentication. See basicAuthHook.

Constructors

EsPassword 

Fields

data Ngram Source #

Constructors

Ngram 

Instances

Eq Ngram Source # 

Methods

(==) :: Ngram -> Ngram -> Bool #

(/=) :: Ngram -> Ngram -> Bool #

Show Ngram Source # 

Methods

showsPrec :: Int -> Ngram -> ShowS #

show :: Ngram -> String #

showList :: [Ngram] -> ShowS #

data Language Source #

The set of languages that can be passed to various analyzers, filters, etc. in Elasticsearch. Most data types in this module that have a Language field are actually only actually to handle a subset of these languages. Consult the official Elasticsearch documentation to see what is actually supported.