bloodhound-0.12.1.0: ElasticSearch client library for Haskell

Copyright(C) 2014, 2015, 2016 Chris Allen
LicenseBSD-style (see the file LICENSE)
MaintainerChris Allen <cma@bitemyapp.com
Stabilityprovisional
PortabilityDeriveGeneric, RecordWildCards
Safe HaskellNone
LanguageHaskell2010

Database.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

omitNulls :: [(Text, Value)] -> Value Source

newtype BH m a Source

Constructors

BH 

Fields

unBH :: ReaderT BHEnv m a
 

Instances

MonadTrans BH Source 
MonadError e m => MonadError e (BH m) Source 
MonadReader r m => MonadReader r (BH m) Source 
MonadState s m => MonadState s (BH m) Source 
MonadWriter w m => MonadWriter w (BH m) Source 
Monad m => Monad (BH m) Source 
Functor m => Functor (BH m) Source 
MonadFix m => MonadFix (BH m) Source 
Applicative m => Applicative (BH m) Source 
Alternative m => Alternative (BH m) Source 
MonadPlus m => MonadPlus (BH m) Source 
MonadIO m => MonadIO (BH m) Source 
MonadThrow m => MonadThrow (BH m) Source 
(Functor m, Applicative m, MonadIO m) => MonadBH (BH m) Source 
MonadMask m => MonadMask (BH m) Source 
MonadCatch m => MonadCatch (BH m) 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.

Instances

bhManager :: BHEnv -> Manager Source

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.

Methods

getBHEnv :: m BHEnv Source

newtype MaybeNA a Source

Constructors

MaybeNA 

Fields

unMaybeNA :: Maybe a
 

Instances

Eq a => Eq (MaybeNA a) Source 
Show a => Show (MaybeNA a) Source 
FromJSON a => FromJSON (MaybeNA a) Source 

newtype BuildHash Source

Typically a 7 character hex string.

Constructors

BuildHash 

Fields

buildHash :: Text
 

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 

Fields

ok :: Maybe Bool
 
status :: Int
 
name :: Text
 
version :: Version
 
tagline :: Text
 

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 
IndexCompoundFormat CompoundFormat 
IndexCompoundOnFlush Bool 
WarmerEnabled Bool 

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 ByteString 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 

Fields

_index :: Text
 
_type :: Text
 
_id :: Text
 
foundResult :: Maybe (EsResultFound a)
 

Instances

Eq a => Eq (EsResult a) Source 
Read a => Read (EsResult a) Source 
Show a => Show (EsResult a) Source 
Generic (EsResult a) Source 
FromJSON a => FromJSON (EsResult a) Source 
type Rep (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

_version :: DocVersion
 
_source :: a
 

Instances

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 

Fields

errorStatus :: Int
 
errorMessage :: Text
 

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.

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 SearchHits a Source

Constructors

SearchHits 

Fields

hitsTotal :: Int
 
maxScore :: Score
 
hits :: [Hit a]
 

Instances

Eq a => Eq (SearchHits a) Source 
Read a => Read (SearchHits a) Source 
Show a => Show (SearchHits a) Source 
Generic (SearchHits a) Source 
Monoid (SearchHits a) Source 
FromJSON a => FromJSON (SearchHits a) Source 
type Rep (SearchHits a) Source 

data Hit a Source

Instances

Eq a => Eq (Hit a) Source 
Read a => Read (Hit a) Source 
Show a => Show (Hit a) Source 
Generic (Hit a) Source 
FromJSON a => FromJSON (Hit a) Source 
type Rep (Hit a) Source 

class Monoid a => Seminearring a where Source

Minimal complete definition

(<||>)

Methods

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

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

data Term Source

Constructors

Term 

Fields

termField :: Text
 
termValue :: Text
 

newtype Regexp Source

Constructors

Regexp Text 

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 

newtype Script Source

Script is often used in place of FieldName to specify more complex ways of extracting a value from a document.

Constructors

Script 

Fields

scriptText :: Text
 

newtype IndexName Source

IndexName is used to describe which index to querycreatedelete

Constructors

IndexName Text 

data IndexSelection Source

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

Constructors

IndexList (NonEmpty IndexName) 
AllIndexes 

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 IndexOptimizationSettings Source

Constructors

IndexOptimizationSettings 

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.

defaultIndexOptimizationSettings :: IndexOptimizationSettings Source

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

newtype TemplateName Source

TemplateName is used to describe which template to querycreatedelete

Constructors

TemplateName Text 

newtype MappingName Source

MappingName is part of mappings which are how ES describes and schematizes the data in the indices.

Constructors

MappingName Text 

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 

newtype CacheName Source

CacheName is used in RegexpFilter for describing the CacheKey keyed caching behavior.

Constructors

CacheName Text 

newtype CacheKey Source

CacheKey is used in RegexpFilter to key regex caching.

Constructors

CacheKey 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.

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk

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 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

type Method = Method Source

newtype QueryString Source

QueryString is used to wrap query text bodies, be they human written or not.

Constructors

QueryString Text 

data BooleanOperator Source

BooleanOperator is the usual And/Or operators with an ES compatible JSON encoding baked in. Used all over the place.

Constructors

And 
Or 

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.

newtype PhraseSlop Source

PhraseSlop sets the default slop for phrases, 0 means exact phrase matches. Default is 0.

Constructors

PhraseSlop Int 

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 AllowLeadingWildcard Source

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 Locale Source

Locale is used for string conversions - defaults to ROOT.

Constructors

Locale Text 

newtype AnalyzeWildcard Source

By default, wildcard terms in a query are not analyzed. Setting AnalyzeWildcard to true enables best-effort analysis.

Constructors

AnalyzeWildcard Bool 

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 
Monoid () 
Monoid All 
Monoid Any 
Monoid ByteString 
Monoid ByteString 
Monoid Builder 
Monoid ShortByteString 
Monoid IntSet 
Monoid More 
Monoid Series 
Monoid RequestBody 
Monoid CookieJar 
Monoid Buffer 
Monoid Buffer 
Monoid Filter 
Monoid [a] 
Ord a => Monoid (Max a) 
Ord a => Monoid (Min a) 
Monoid a => Monoid (Dual a) 
Monoid (Endo a) 
Num a => Monoid (Sum a) 
Num a => Monoid (Product a) 
Monoid (First a) 
Monoid (Last 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 is no "Semigroup" typeclass providing just mappend, we use Monoid instead.

Monoid (IntMap a) 
Ord a => Monoid (Set a) 
Monoid (Seq a) 
Monoid (IResult a) 
Monoid (Result a) 
Monoid (DList a) 
(Hashable a, Eq a) => Monoid (HashSet a) 
Monoid m => Monoid (WrappedMonoid m) 
Semigroup a => Monoid (Option a) 
(Ord a, Bounded a) => Monoid (Min a) 
(Ord a, Bounded a) => Monoid (Max a) 
Monoid (Vector a) 
Prim a => Monoid (Vector a) 
Storable a => Monoid (Vector a) 
Monoid (Parser a) 
Monoid (SearchHits a) 
Monoid b => Monoid (a -> b) 
(Monoid a, Monoid b) => Monoid (a, b) 
Monoid a => Monoid (Const a b) 
Monoid (Proxy k s) 
Ord k => Monoid (Map k v) 
Monoid (Parser i a) 
(Eq k, Hashable k) => Monoid (HashMap k v) 
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) 
Alternative f => Monoid (Alt * f a) 
Monoid a => Monoid (Tagged k s a) 
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) 
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) 

class ToJSON a where

Minimal complete definition

Nothing

Methods

toJSON :: a -> Value

toEncoding :: a -> Encoding

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 Ordering 
ToJSON Word 
ToJSON Word8 
ToJSON Word16 
ToJSON Word32 
ToJSON Word64 
ToJSON () 
ToJSON Natural 
ToJSON Version 
ToJSON IntSet 
ToJSON LocalTime 
ToJSON ZonedTime 
ToJSON TimeOfDay 
ToJSON UTCTime 
ToJSON NominalDiffTime 
ToJSON Day 
ToJSON Value 
ToJSON DotNetTime 
ToJSON Text 
ToJSON Scientific 
ToJSON Number 
ToJSON Text 
ToJSON UUID 
ToJSON RestoreIndexSettings 
ToJSON RestoreRenamePattern 
ToJSON SnapshotName 
ToJSON BuildHash 
ToJSON GenericSnapshotRepoSettings 
ToJSON SnapshotRepoType 
ToJSON SnapshotRepoName 
ToJSON DateMathExpr 
ToJSON DateRangeAggRange 
ToJSON DateRangeAggregation 
ToJSON Aggregation 
ToJSON Interval 
ToJSON ExecutionHint 
ToJSON CollectionMode 
ToJSON TermInclusion 
ToJSON TermOrder 
ToJSON ScrollId 
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 Filter 
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 HighlightEncoder 
ToJSON HighlightSettings 
ToJSON FieldHighlight 
ToJSON Highlights 
ToJSON Pattern 
ToJSON Exclude 
ToJSON Include 
ToJSON PatternOrPatterns 
ToJSON Source 
ToJSON Search 
ToJSON Size 
ToJSON From 
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 BoostTerms 
ToJSON Boost 
ToJSON Tiebreaker 
ToJSON Lenient 
ToJSON MaxExpansions 
ToJSON Analyzer 
ToJSON CutoffFrequency 
ToJSON NullValue 
ToJSON Existence 
ToJSON CacheKey 
ToJSON CacheName 
ToJSON FieldName 
ToJSON QueryString 
ToJSON DocId 
ToJSON MappingName 
ToJSON TemplatePattern 
ToJSON TemplateName 
ToJSON IndexName 
ToJSON ReplicaCount 
ToJSON ShardCount 
ToJSON BooleanOperator 
ToJSON SortMode 
ToJSON Missing 
ToJSON SortOrder 
ToJSON SortSpec 
ToJSON ExternalDocVersion 
ToJSON DocVersion 
ToJSON RoutingValue 
ToJSON IndexAliasRouting 
ToJSON SearchAliasRouting 
ToJSON AliasRouting 
ToJSON IndexAliasCreate 
ToJSON IndexAliasAction 
ToJSON IndexAliasName 
ToJSON IndexAlias 
ToJSON IndexTemplate 
ToJSON CompoundFormat 
ToJSON InitialShardCount 
ToJSON FSType 
ToJSON Bytes 
ToJSON ReplicaBounds 
ToJSON AllocationPolicy 
ToJSON UpdatableIndexSetting 
ToJSON IndexSettings 
ToJSON VersionNumber 
ToJSON Version 
ToJSON a => ToJSON [a] 
(ToJSON a, Integral a) => ToJSON (Ratio a) 
ToJSON a => ToJSON (Identity a) 
HasResolution a => ToJSON (Fixed a) 
ToJSON a => ToJSON (Dual a) 
ToJSON a => ToJSON (First a) 
ToJSON a => ToJSON (Last a) 
ToJSON a => ToJSON (Maybe a) 
ToJSON a => ToJSON (IntMap a) 
ToJSON a => ToJSON (Set a) 
ToJSON v => ToJSON (Tree v) 
ToJSON a => ToJSON (Seq a) 
(Vector Vector a, ToJSON a) => ToJSON (Vector a) 
ToJSON a => ToJSON (DList a) 
ToJSON a => ToJSON (NonEmpty a) 
ToJSON a => ToJSON (HashSet a) 
ToJSON a => ToJSON (WrappedMonoid a) 
ToJSON a => ToJSON (Option a) 
ToJSON a => ToJSON (Min a) 
ToJSON a => ToJSON (Max a) 
ToJSON a => ToJSON (Last a) 
ToJSON a => ToJSON (First a) 
ToJSON a => ToJSON (Vector a) 
(Prim a, ToJSON a) => ToJSON (Vector a) 
(Storable a, ToJSON a) => ToJSON (Vector a) 
(ToJSON a, ToJSON b) => ToJSON (Either a b) 
(ToJSON a, ToJSON b) => ToJSON (a, b) 
ToJSON a => ToJSON (Const a b) 
ToJSON (Proxy k a) 
(ToJSON v, ToJSONKey k) => ToJSON (Map k v) 
(ToJSON v, ToJSONKey k) => ToJSON (HashMap k v) 
(ToJSON a, ToJSON b, ToJSON c) => ToJSON (a, b, c) 
(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Sum f g a) 
(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Product f g a) 
(ToJSON1 f, ToJSON1 g, ToJSON a) => ToJSON (Compose f g a) 
ToJSON b => ToJSON (Tagged k a b) 
(ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON (a, b, c, d) 
(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON (a, b, c, d, e) 
(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON (a, b, c, d, e, f) 
(ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g) => ToJSON (a, b, c, d, e, f, g) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 
(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) 

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

data 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

fullNodeId :: Text
 

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

nodeName :: Text
 

data NodeIndicesStats Source

Constructors

NodeIndicesStats 

Fields

nodeIndicesStatsRecoveryThrottleTime :: Maybe NominalDiffTime
 
nodeIndicesStatsRecoveryCurrentAsTarget :: Maybe Int
 
nodeIndicesStatsRecoveryCurrentAsSource :: Maybe Int
 
nodeIndicesStatsQueryCacheMisses :: Maybe Int
 
nodeIndicesStatsQueryCacheHits :: Maybe Int
 
nodeIndicesStatsQueryCacheEvictions :: Maybe Int
 
nodeIndicesStatsQueryCacheSize :: Maybe Bytes
 
nodeIndicesStatsSuggestCurrent :: Int
 
nodeIndicesStatsSuggestTime :: NominalDiffTime
 
nodeIndicesStatsSuggestTotal :: Int
 
nodeIndicesStatsTranslogSize :: Bytes
 
nodeIndicesStatsTranslogOps :: Int
 
nodeIndicesStatsSegFixedBitSetMemory :: Maybe Bytes
 
nodeIndicesStatsSegVersionMapMemory :: Bytes
 
nodeIndicesStatsSegIndexWriterMaxMemory :: Maybe Bytes
 
nodeIndicesStatsSegIndexWriterMemory :: Bytes
 
nodeIndicesStatsSegMemory :: Bytes
 
nodeIndicesStatsSegCount :: Int
 
nodeIndicesStatsCompletionSize :: Bytes
 
nodeIndicesStatsPercolateQueries :: Int
 
nodeIndicesStatsPercolateMemory :: Bytes
 
nodeIndicesStatsPercolateCurrent :: Int
 
nodeIndicesStatsPercolateTime :: NominalDiffTime
 
nodeIndicesStatsPercolateTotal :: Int
 
nodeIndicesStatsFieldDataEvictions :: Int
 
nodeIndicesStatsFieldDataMemory :: Bytes
 
nodeIndicesStatsIDCacheMemory :: Bytes
 
nodeIndicesStatsFilterCacheEvictions :: Int
 
nodeIndicesStatsFilterCacheMemory :: Bytes
 
nodeIndicesStatsWarmerTotalTime :: NominalDiffTime
 
nodeIndicesStatsWarmerTotal :: Int
 
nodeIndicesStatsWarmerCurrent :: Int
 
nodeIndicesStatsFlushTotalTime :: NominalDiffTime
 
nodeIndicesStatsFlushTotal :: Int
 
nodeIndicesStatsRefreshTotalTime :: NominalDiffTime
 
nodeIndicesStatsRefreshTotal :: Int
 
nodeIndicesStatsMergesTotalSize :: Bytes
 
nodeIndicesStatsMergesTotalDocs :: Int
 
nodeIndicesStatsMergesTotalTime :: NominalDiffTime
 
nodeIndicesStatsMergesTotal :: Int
 
nodeIndicesStatsMergesCurrentSize :: Bytes
 
nodeIndicesStatsMergesCurrentDocs :: Int
 
nodeIndicesStatsMergesCurrent :: Int
 
nodeIndicesStatsSearchFetchCurrent :: Int
 
nodeIndicesStatsSearchFetchTime :: NominalDiffTime
 
nodeIndicesStatsSearchFetchTotal :: Int
 
nodeIndicesStatsSearchQueryCurrent :: Int
 
nodeIndicesStatsSearchQueryTime :: NominalDiffTime
 
nodeIndicesStatsSearchQueryTotal :: Int
 
nodeIndicesStatsSearchOpenContexts :: Int
 
nodeIndicesStatsGetCurrent :: Int
 
nodeIndicesStatsGetMissingTime :: NominalDiffTime
 
nodeIndicesStatsGetMissingTotal :: Int
 
nodeIndicesStatsGetExistsTime :: NominalDiffTime
 
nodeIndicesStatsGetExistsTotal :: Int
 
nodeIndicesStatsGetTime :: NominalDiffTime
 
nodeIndicesStatsGetTotal :: Int
 
nodeIndicesStatsIndexingThrottleTime :: Maybe NominalDiffTime
 
nodeIndicesStatsIndexingIsThrottled :: Maybe Bool
 
nodeIndicesStatsIndexingNoopUpdateTotal :: Maybe Int
 
nodeIndicesStatsIndexingDeleteCurrent :: Int
 
nodeIndicesStatsIndexingDeleteTime :: NominalDiffTime
 
nodeIndicesStatsIndexingDeleteTotal :: Int
 
nodeIndicesStatsIndexingIndexCurrent :: Int
 
nodeIndicesStatsIndexingIndexTime :: NominalDiffTime
 
nodeIndicesStatsIndexingTotal :: Int
 
nodeIndicesStatsStoreThrottleTime :: NominalDiffTime
 
nodeIndicesStatsStoreSize :: Bytes
 
nodeIndicesStatsDocsDeleted :: Int
 
nodeIndicesStatsDocsCount :: Int
 

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

esAddress :: Text
 

newtype PID Source

Constructors

PID 

Fields

pid :: Int
 

Instances

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

fsrName :: SnapshotRepoName
 
fsrLocation :: FilePath
 
fsrCompressMetadata :: Bool
 
fsrChunkSize :: Maybe Bytes

Size by which to split large files during snapshotting.

fsrMaxRestoreBytesPerSec :: Maybe Bytes

Throttle node restore rate. If not supplied, defaults to 40mb/sec

fsrMaxSnapshotBytesPerSec :: Maybe Bytes

Throttle node snapshot rate. If not supplied, defaults to 40mb/sec

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

Constructors

ExactSnap SnapshotName 
SnapPattern Text 

newtype ShardId Source

Constructors

ShardId 

Fields

shardId :: Int
 

data SnapshotRestoreSettings Source

Constructors

SnapshotRestoreSettings 

Fields

snapRestoreWaitForCompletion :: Bool

Should the API call return immediately after initializing the restore 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.

snapRestoreIndices :: Maybe IndexSelection

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

snapRestoreIgnoreUnavailable :: Bool

If set to True, any indices that do not exist will be ignored during snapshot rather than failing the restore.

snapRestoreIncludeGlobalState :: Bool

If set to false, will ignore any global state in the snapshot and will not restore it.

snapRestoreRenamePattern :: Maybe RestoreRenamePattern

A regex pattern for matching indices. Used with snapRestoreRenameReplacement, the restore can reference the matched index and create a new index name upon restore.

snapRestoreRenameReplacement :: Maybe (NonEmpty RestoreRenameToken)

Expression of how index renames should be constructed.

snapRestorePartial :: Bool

If some indices fail to restore, should the process proceed?

snapRestoreIncludeAliases :: Bool

Should the restore also restore the aliases captured in the snapshot.

snapRestoreIndexSettingsOverrides :: Maybe RestoreIndexSettings

Settings to apply during the restore process. NOTE: This option is not supported in ES < 1.5 and should be set to Nothing in that case.

snapRestoreIgnoreIndexSettings :: Maybe (NonEmpty Text)

This type could be more rich but it isn't clear which settings are allowed to be ignored during restore, so we're going with including this feature in a basic form rather than omitting it. One example here would be "index.refresh_interval". Any setting specified here will revert back to the server default during the restore process.

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

data RRGroupRefNum Source

A group number for regex matching. Only values from 1-9 are supported. Construct with mkRRGroupRefNum

mkRRGroupRefNum :: Int -> Maybe RRGroupRefNum Source

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

data RestoreIndexSettings Source

Index settings that can be overridden. The docs only mention you can update number of replicas, but there may be more. You definitely cannot override shard count.

type AggregationResults = Map Text Value Source

data Bucket a Source

Constructors

Bucket 

Fields

buckets :: [a]
 

Instances

Read a => Read (Bucket a) Source 
Show a => Show (Bucket a) Source 
FromJSON a => FromJSON (Bucket a) Source 

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 

type HitHighlight = Map Text [Text] Source

newtype EsUsername Source

Username type used for HTTP Basic authentication. See basicAuthHook.

Constructors

EsUsername 

Fields

esUsername :: Text
 

newtype EsPassword Source

Password type used for HTTP Basic authentication. See basicAuthHook.

Constructors

EsPassword 

Fields

esPassword :: Text