@@ -378,250 +378,53 @@ module Database.V1.Bloodhound.Types
378 , EsPassword(..)
378 , EsPassword(..)
381−import Control.Applicative as A
381+import Control.Applicative as A
382−import Control.Arrow (first)
382+import Control.Arrow (first)
383import Control.Monad.Catch
383import Control.Monad.Catch
384import Control.Monad.Except
384import Control.Monad.Except
385−import Control.Monad.Reader (MonadReader (..),
385+import Control.Monad.Reader (MonadReader (..),
386− ReaderT (..))
386+ ReaderT (..))
387−import Control.Monad.State (MonadState)
387+import Control.Monad.State (MonadState)
388−import Control.Monad.Writer (MonadWriter)
388+import Control.Monad.Writer (MonadWriter)
389import Data.Aeson
389import Data.Aeson
390−import Data.Aeson.Types (Pair, Parser,
390+import Data.Aeson.Types (Pair, Parser,
391− emptyObject,
391+ emptyObject,
392− parseEither, parseMaybe,
392+ parseEither,
393− typeMismatch)
394+ typeMismatch)
394−import qualified Data.ByteString.Lazy.Char8 as L
395+import qualified Data.ByteString.Lazy.Char8 as L
395import Data.Char
396import Data.Char
396−import Data.Hashable (Hashable)
397+import Data.Hashable (Hashable)
397−import qualified Data.HashMap.Strict as HM
398+import qualified Data.HashMap.Strict as HM
398−import Data.List (foldl', intercalate,
399+import Data.List (foldl', intercalate,
400−import Data.List.NonEmpty (NonEmpty (..), toList)
401+import Data.List.NonEmpty (NonEmpty (..), toList)
401−import qualified Data.Map.Strict as M
402+import qualified Data.Map.Strict as M
402import Data.Maybe
403import Data.Maybe
403−import Data.Scientific (Scientific)
404+import Data.Scientific (Scientific)
404import Data.Semigroup
405import Data.Semigroup
405−import Data.Text (Text)
406+import Data.Text (Text)
406−import qualified Data.Text as T
407+import qualified Data.Text as T
407import Data.Time.Calendar
408import Data.Time.Calendar
408−import Data.Time.Clock (NominalDiffTime,
409+import Data.Time.Clock (NominalDiffTime,
409− UTCTime)
410+ UTCTime)
410import Data.Time.Clock.POSIX
411import Data.Time.Clock.POSIX
411−import qualified Data.Traversable as DT
412+import qualified Data.Traversable as DT
412−import Data.Typeable (Typeable)
413+import Data.Typeable (Typeable)
413−import qualified Data.Vector as V
414+import qualified Data.Vector as V
414−import qualified Data.Version as Vers
415+import qualified Data.Version as Vers
415import GHC.Enum
416import GHC.Enum
416−import GHC.Generics (Generic)
417+import GHC.Generics (Generic)
417import Network.HTTP.Client
418import Network.HTTP.Client
418−import qualified Network.HTTP.Types.Method as NHTM
419+import qualified Network.HTTP.Types.Method as NHTM
419−import qualified Text.ParserCombinators.ReadP as RP
420+import qualified Text.ParserCombinators.ReadP as RP
420−import qualified Text.Read as TR
421+import qualified Text.Read as TR
423+import Database.V1.Bloodhound.Internal.Client
422import Database.V1.Bloodhound.Types.Class
424import Database.V1.Bloodhound.Types.Class
423import Database.V1.Bloodhound.Types.Internal
425import Database.V1.Bloodhound.Types.Internal
426−-- >>> :set -XOverloadedStrings
427−-- >>> import Data.Aeson
428−-- >>> import Database.V1.Bloodhound
429−-- >>> let testServer = (Server "http://localhost:9200")
430−-- >>> let testIndex = IndexName "twitter"
431−-- >>> let testMapping = MappingName "tweet"
432−-- >>> let defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
434−-- defaultIndexSettings is exported by Database.Bloodhound as well
435−-- no trailing slashes in servers, library handles building the path.
437−-- | Create a 'BHEnv' with all optional fields defaulted. HTTP hook
438−-- will be a noop. You can use the exported fields to customize it further, e.g.:
440−-- >> (mkBHEnv myServer myManager) { bhRequestHook = customHook }
441−mkBHEnv :: Server -> Manager -> BHEnv
442−mkBHEnv s m = BHEnv s m return
444−newtype BH m a = BH {
445− unBH :: ReaderT BHEnv m a
446− } deriving ( Functor
460−instance MonadTrans BH where
463−instance (MonadReader r m) => MonadReader r (BH m) where
465− local f (BH (ReaderT m)) = BH $ ReaderT $ \r ->
468−instance (Functor m, Applicative m, MonadIO m) => MonadBH (BH m) where
469− getBHEnv = BH getBHEnv
471−runBH :: BHEnv -> BH m a -> m a
472−runBH e f = runReaderT (unBH f) e
474−{-| 'Version' is embedded in 'Status' -}
475−data Version = Version { number :: VersionNumber
476− , build_hash :: BuildHash
477− , build_timestamp :: UTCTime
478− , build_snapshot :: Bool
479− , lucene_version :: VersionNumber } deriving (Eq, Read, Show, Generic, Typeable)
481−-- | Traditional software versioning number
482−newtype VersionNumber = VersionNumber { versionNumber :: Vers.Version
483− } deriving (Eq, Read, Show, Generic, Typeable, Ord)
485−{-| 'Status' is a data type for describing the JSON body returned by
486− Elasticsearch when you query its status. This was deprecated in 1.2.0.
488− <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-status.html#indices-status>
491−data Status = Status { ok :: Maybe Bool
494− , version :: Version
495− , tagline :: Text } deriving (Eq, Read, Show, Generic)
497−{-| 'IndexSettings' is used to configure the shards and replicas when you create
498− an Elasticsearch Index.
500− <http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html>
504− IndexSettings { indexShards :: ShardCount
505− , indexReplicas :: ReplicaCount } deriving (Eq, Read, Show, Generic, Typeable)
507−{-| 'defaultIndexSettings' is an 'IndexSettings' with 3 shards and 2 replicas. -}
508−defaultIndexSettings :: IndexSettings
509−defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
512−{-| 'IndexOptimizationSettings' is used to configure index optimization. See
513− <https://www.elastic.co/guide/en/elasticsearch/reference/1.7/indices-optimize.html>
516−data IndexOptimizationSettings =
517− IndexOptimizationSettings { maxNumSegments :: Maybe Int
518− -- ^ 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.
519− , onlyExpungeDeletes :: Bool
520− -- ^ 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.
521− , flushAfterOptimize :: Bool
522− -- ^ Should a flush be performed after the optimize.
523− } deriving (Eq, Show, Generic, Typeable)
526−{-| 'defaultIndexOptimizationSettings' implements the default settings that
527− ElasticSearch uses for index optimization. 'maxNumSegments' is Nothing,
528− 'onlyExpungeDeletes' is False, and flushAfterOptimize is True.
530−defaultIndexOptimizationSettings :: IndexOptimizationSettings
531−defaultIndexOptimizationSettings = IndexOptimizationSettings Nothing False True
533−{-| 'UpdatableIndexSetting' are settings which may be updated after an index is created.
535− <https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html>
537−data UpdatableIndexSetting = NumberOfReplicas ReplicaCount
538− -- ^ The number of replicas each shard has.
539− | AutoExpandReplicas ReplicaBounds
540− | BlocksReadOnly Bool
541− -- ^ Set to True to have the index read only. False to allow writes and metadata changes.
543− -- ^ Set to True to disable read operations against the index.
545− -- ^ Set to True to disable write operations against the index.
546− | BlocksMetaData Bool
547− -- ^ Set to True to disable metadata operations against the index.
548− | RefreshInterval NominalDiffTime
549− -- ^ The async refresh interval of a shard
550− | IndexConcurrency Int
551− | FailOnMergeFailure Bool
552− | TranslogFlushThresholdOps Int
553− -- ^ When to flush on operations.
554− | TranslogFlushThresholdSize Bytes
555− -- ^ When to flush based on translog (bytes) size.
556− | TranslogFlushThresholdPeriod NominalDiffTime
557− -- ^ When to flush based on a period of not flushing.
558− | TranslogDisableFlush Bool
559− -- ^ Disables flushing. Note, should be set for a short interval and then enabled.
560− | CacheFilterMaxSize (Maybe Bytes)
561− -- ^ The maximum size of filter cache (per segment in shard).
562− | CacheFilterExpire (Maybe NominalDiffTime)
563− -- ^ The expire after access time for filter cache.
564− | GatewaySnapshotInterval NominalDiffTime
565− -- ^ The gateway snapshot interval (only applies to shared gateways).
566− | RoutingAllocationInclude (NonEmpty NodeAttrFilter)
567− -- ^ A node matching any rule will be allowed to host shards from the index.
568− | RoutingAllocationExclude (NonEmpty NodeAttrFilter)
569− -- ^ A node matching any rule will NOT be allowed to host shards from the index.
570− | RoutingAllocationRequire (NonEmpty NodeAttrFilter)
571− -- ^ Only nodes matching all rules will be allowed to host shards from the index.
572− | RoutingAllocationEnable AllocationPolicy
573− -- ^ Enables shard allocation for a specific index.
574− | RoutingAllocationShardsPerNode ShardCount
575− -- ^ Controls the total number of shards (replicas and primaries) allowed to be allocated on a single node.
576− | RecoveryInitialShards InitialShardCount
577− -- ^ When using local gateway a particular shard is recovered only if there can be allocated quorum shards in the cluster.
578− | GCDeletes NominalDiffTime
579− | TTLDisablePurge Bool
580− -- ^ Disables temporarily the purge of expired docs.
581− | TranslogFSType FSType
582− | IndexCompoundFormat CompoundFormat
583− | IndexCompoundOnFlush Bool
584− | WarmerEnabled Bool
585− deriving (Eq, Show, Generic, Typeable)
587−data AllocationPolicy = AllocAll
588− -- ^ Allows shard allocation for all shards.
590− -- ^ Allows shard allocation only for primary shards.
592− -- ^ Allows shard allocation only for primary shards for new indices.
594− -- ^ No shard allocation is allowed
595− deriving (Eq, Read, Show, Generic, Typeable)
597−data ReplicaBounds = ReplicasBounded Int Int
598− | ReplicasLowerBounded Int
600− deriving (Eq, Read, Show, Generic, Typeable)
602−-- | A measure of bytes used for various configurations. You may want
603−-- to use smart constructors like 'gigabytes' for larger values.
613−newtype Bytes = Bytes Int deriving (Eq, Read, Show, Generic, Typeable, Ord, ToJSON, FromJSON)
615−gigabytes :: Int -> Bytes
616−gigabytes n = megabytes (1000 * n)
619−megabytes :: Int -> Bytes
620−megabytes n = kilobytes (1000 * n)
623−kilobytes :: Int -> Bytes
624−kilobytes n = Bytes (1000 * n)
627data FSType = FSSimple
430data FSType = FSSimple
@@ -1739,13 +1542,6 @@ readMay s = case reads s of
1739parseReadText :: Read a => Text -> Parser a
1542parseReadText :: Read a => Text -> Parser a
1740parseReadText = maybe mzero return . readMay . T.unpack
1543parseReadText = maybe mzero return . readMay . T.unpack
1742−type Aggregations = M.Map Text Aggregation
1744−emptyAggregations :: Aggregations
1745−emptyAggregations = M.empty
1747−mkAggregations :: Text -> Aggregation -> Aggregations
1748−mkAggregations name aggregation = M.insert name aggregation emptyAggregations
1750data TermOrder = TermOrder{ termSortField :: Text
1546data TermOrder = TermOrder{ termSortField :: Text
1751 , termSortOrder :: SortOrder } deriving (Eq, Read, Show, Generic, Typeable)
1547 , termSortOrder :: SortOrder } deriving (Eq, Read, Show, Generic, Typeable)
@@ -1778,62 +1574,6 @@ data Interval = Year
1778 | Second
1574 | Second
1779 | FractionalInterval Float TimeInterval deriving (Eq, Read, Show, Generic, Typeable)
1575 | FractionalInterval Float TimeInterval deriving (Eq, Read, Show, Generic, Typeable)
1781−data Aggregation = TermsAgg TermsAggregation
1782− | CardinalityAgg CardinalityAggregation
1783− | DateHistogramAgg DateHistogramAggregation
1784− | ValueCountAgg ValueCountAggregation
1785− | FilterAgg FilterAggregation
1786− | DateRangeAgg DateRangeAggregation
1787− | MissingAgg MissingAggregation
1788− | TopHitsAgg TopHitsAggregation
1789− deriving (Eq, Read, Show, Generic, Typeable)
1791−data TopHitsAggregation = TopHitsAggregation
1792− { taFrom :: Maybe From
1793− , taSize :: Maybe Size
1794− , taSort :: Maybe Sort
1795− } deriving (Eq, Read, Show)
1797−data MissingAggregation = MissingAggregation
1799− } deriving (Eq, Read, Show, Generic, Typeable)
1801−data TermsAggregation = TermsAggregation { term :: Either Text Text
1802− , termInclude :: Maybe TermInclusion
1803− , termExclude :: Maybe TermInclusion
1804− , termOrder :: Maybe TermOrder
1805− , termMinDocCount :: Maybe Int
1806− , termSize :: Maybe Int
1807− , termShardSize :: Maybe Int
1808− , termCollectMode :: Maybe CollectionMode
1809− , termExecutionHint :: Maybe ExecutionHint
1810− , termAggs :: Maybe Aggregations
1811− } deriving (Eq, Read, Show, Generic, Typeable)
1813−data CardinalityAggregation = CardinalityAggregation { cardinalityField :: FieldName,
1814− precisionThreshold :: Maybe Int
1815− } deriving (Eq, Read, Show, Generic, Typeable)
1817−data DateHistogramAggregation = DateHistogramAggregation { dateField :: FieldName
1818− , dateInterval :: Interval
1819− , dateFormat :: Maybe Text
1820− -- pre and post deprecated in 1.5
1821− , datePreZone :: Maybe Text
1822− , datePostZone :: Maybe Text
1823− , datePreOffset :: Maybe Text
1824− , datePostOffset :: Maybe Text
1825− , dateAggs :: Maybe Aggregations
1826− } deriving (Eq, Read, Show, Generic, Typeable)
1829−data DateRangeAggregation = DateRangeAggregation { draField :: FieldName
1830− , draFormat :: Maybe Text
1831− , draRanges :: NonEmpty DateRangeAggRange
1832− } deriving (Eq, Read, Show, Generic, Typeable)
1834−data DateRangeAggRange = DateRangeFrom DateMathExpr
1835− | DateRangeTo DateMathExpr
1836− | DateRangeFromAndTo DateMathExpr DateMathExpr deriving (Eq, Read, Show, Generic, Typeable)
1838-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math> for more information.
1578-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math> for more information.
1839data DateMathExpr = DateMathExpr DateMathAnchor [DateMathModifier] deriving (Eq, Read, Show, Generic, Typeable)
1579data DateMathExpr = DateMathExpr DateMathAnchor [DateMathModifier] deriving (Eq, Read, Show, Generic, Typeable)
@@ -1855,26 +1595,6 @@ data DateMathUnit = DMYear
1855 | DMMinute
1595 | DMMinute
1856 | DMSecond deriving (Eq, Read, Show, Generic, Typeable)
1596 | DMSecond deriving (Eq, Read, Show, Generic, Typeable)
1858−-- | See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html> for more information.
1859−data ValueCountAggregation = FieldValueCount FieldName
1860− | ScriptValueCount Script deriving (Eq, Read, Show, Generic, Typeable)
1862−-- | Single-bucket filter aggregations. See <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filter-aggregation.html#search-aggregations-bucket-filter-aggregation> for more information.
1863−data FilterAggregation = FilterAggregation { faFilter :: Filter
1864− , faAggs :: Maybe Aggregations} deriving (Eq, Read, Show, Generic, Typeable)
1866−mkTermsAggregation :: Text -> TermsAggregation
1867−mkTermsAggregation t = TermsAggregation (Left t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
1869−mkTermsScriptAggregation :: Text -> TermsAggregation
1870−mkTermsScriptAggregation t = TermsAggregation (Right t) Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
1872−mkDateHistogram :: FieldName -> Interval -> DateHistogramAggregation
1873−mkDateHistogram t i = DateHistogramAggregation t i Nothing Nothing Nothing Nothing Nothing Nothing
1875−mkCardinalityAggregation :: FieldName -> CardinalityAggregation
1876−mkCardinalityAggregation t = CardinalityAggregation t Nothing
1878instance ToJSON Version where
1598instance ToJSON Version where
1879 toJSON Version {..} = object ["number" .= number
1599 toJSON Version {..} = object ["number" .= number
1880 ,"build_hash" .= build_hash
1600 ,"build_hash" .= build_hash
@@ -1950,56 +1670,6 @@ instance Read TimeInterval where
1950 f 's' = return Seconds
1670 f 's' = return Seconds
1951 f _ = fail "TimeInterval expected one of w, d, h, m, s"
1671 f _ = fail "TimeInterval expected one of w, d, h, m, s"
1953−instance ToJSON Aggregation where
1954− toJSON (TermsAgg (TermsAggregation term include exclude order minDocCount size shardSize collectMode executionHint termAggs)) =
1955− omitNulls ["terms" .= omitNulls [ toJSON' term,
1956− "include" .= include,
1957− "exclude" .= exclude,
1959− "min_doc_count" .= minDocCount,
1961− "shard_size" .= shardSize,
1962− "collect_mode" .= collectMode,
1963− "execution_hint" .= executionHint
1965− "aggs" .= termAggs ]
1967− toJSON' x = case x of { Left y -> "field" .= y; Right y -> "script" .= y }
1969− toJSON (CardinalityAgg (CardinalityAggregation field precisionThreshold)) =
1970− object ["cardinality" .= omitNulls [ "field" .= field,
1971− "precisionThreshold" .= precisionThreshold
1975− toJSON (DateHistogramAgg (DateHistogramAggregation field interval format preZone postZone preOffset postOffset dateHistoAggs)) =
1976− omitNulls ["date_histogram" .= omitNulls [ "field" .= field,
1977− "interval" .= interval,
1978− "format" .= format,
1979− "pre_zone" .= preZone,
1980− "post_zone" .= postZone,
1981− "pre_offset" .= preOffset,
1982− "post_offset" .= postOffset
1984− "aggs" .= dateHistoAggs ]
1985− toJSON (ValueCountAgg a) = object ["value_count" .= v]
1986− where v = case a of
1987− (FieldValueCount (FieldName n)) -> object ["field" .= n]
1988− (ScriptValueCount (Script s)) -> object ["script" .= s]
1989− toJSON (FilterAgg (FilterAggregation filt ags)) =
1990− omitNulls [ "filter" .= filt
1992− toJSON (DateRangeAgg a) = object [ "date_range" .= a
1994− toJSON (MissingAgg (MissingAggregation{..})) =
1995− object ["missing" .= object ["field" .= maField]]
1997− toJSON (TopHitsAgg (TopHitsAggregation mfrom msize msort)) =
1998− omitNulls ["top_hits" .= omitNulls [ "size" .= msize
2004instance ToJSON DateRangeAggregation where
1674instance ToJSON DateRangeAggregation where
2005 toJSON DateRangeAggregation {..} =
1675 toJSON DateRangeAggregation {..} =
@@ -5358,7 +5028,7 @@ instance FromJSON Suggest where
5358 let dropTextList = HM.toList $ HM.filterWithKey (\x _ -> x /= "text") o
5028 let dropTextList = HM.toList $ HM.filterWithKey (\x _ -> x /= "text") o
5359 suggestName' <- case dropTextList of
5029 suggestName' <- case dropTextList of
5360 [(x, _)] -> return x
5030 [(x, _)] -> return x
5361− _ -> fail "error parsing Suggest field name"
5031+ _ -> fail "error parsing Suggest field name"
5362 suggestType' <- o .: suggestName'
5032 suggestType' <- o .: suggestName'
5363 return $ Suggest suggestText' suggestName' suggestType'
5033 return $ Suggest suggestText' suggestName' suggestType'
5364 parseJSON x = typeMismatch "Suggest" x
5034 parseJSON x = typeMismatch "Suggest" x
@@ -5428,7 +5098,7 @@ mkPhraseSuggester fName =
5428 Nothing Nothing Nothing Nothing []
5098 Nothing Nothing Nothing Nothing []
5430data PhraseSuggesterHighlighter =
5100data PhraseSuggesterHighlighter =
5431− PhraseSuggesterHighlighter { phraseSuggesterHighlighterPreTag :: Text
5101+ PhraseSuggesterHighlighter { phraseSuggesterHighlighterPreTag :: Text
5432 , phraseSuggesterHighlighterPostTag :: Text
5102 , phraseSuggesterHighlighterPostTag :: Text
5434 deriving (Show, Generic, Eq, Read, Typeable)
5104 deriving (Show, Generic, Eq, Read, Typeable)
@@ -5469,9 +5139,9 @@ instance FromJSON PhraseSuggesterCollate where
5469 parseJSON x = typeMismatch "PhraseSuggesterCollate" x
5139 parseJSON x = typeMismatch "PhraseSuggesterCollate" x
5471data SuggestOptions =
5141data SuggestOptions =
5472− SuggestOptions { suggestOptionsText :: Text
5142+ SuggestOptions { suggestOptionsText :: Text
5473− , suggestOptionsScore :: Double
5143+ , suggestOptionsScore :: Double
5474− , suggestOptionsFreq :: Maybe Int
5144+ , suggestOptionsFreq :: Maybe Int
5475 , suggestOptionsHighlighted :: Maybe Text
5145 , suggestOptionsHighlighted :: Maybe Text
5477 deriving (Eq, Read, Show)
5147 deriving (Eq, Read, Show)
@@ -5485,9 +5155,9 @@ instance FromJSON SuggestOptions where
5485 <*> o .:? "highlighted"
5155 <*> o .:? "highlighted"
5487data SuggestResponse =
5157data SuggestResponse =
5488− SuggestResponse { suggestResponseText :: Text
5158+ SuggestResponse { suggestResponseText :: Text
5489− , suggestResponseOffset :: Int
5159+ , suggestResponseOffset :: Int
5490− , suggestResponseLength :: Int
5160+ , suggestResponseLength :: Int
5491 , suggestResponseOptions :: [SuggestOptions]
5161 , suggestResponseOptions :: [SuggestOptions]
5493 deriving (Eq, Read, Show)
5163 deriving (Eq, Read, Show)
@@ -5501,7 +5171,7 @@ instance FromJSON SuggestResponse where
5501 <*> o .: "options"
5171 <*> o .: "options"
5503data NamedSuggestionResponse =
5173data NamedSuggestionResponse =
5504− NamedSuggestionResponse { nsrName :: Text
5174+ NamedSuggestionResponse { nsrName :: Text
5505 , nsrResponses :: [SuggestResponse]
5175 , nsrResponses :: [SuggestResponse]
5507 deriving (Eq, Read, Show)
5177 deriving (Eq, Read, Show)
@@ -5524,7 +5194,7 @@ data DirectGeneratorSuggestModeTypes = DirectGeneratorSuggestModeMissing
5524instance ToJSON DirectGeneratorSuggestModeTypes where
5194instance ToJSON DirectGeneratorSuggestModeTypes where
5525 toJSON DirectGeneratorSuggestModeMissing = "missing"
5195 toJSON DirectGeneratorSuggestModeMissing = "missing"
5526 toJSON DirectGeneratorSuggestModePopular = "popular"
5196 toJSON DirectGeneratorSuggestModePopular = "popular"
5527− toJSON DirectGeneratorSuggestModeAlways = "always"
5197+ toJSON DirectGeneratorSuggestModeAlways = "always"
5529instance FromJSON DirectGeneratorSuggestModeTypes where
5199instance FromJSON DirectGeneratorSuggestModeTypes where
5530 parseJSON = withText "DirectGeneratorSuggestModeTypes" parse
5200 parseJSON = withText "DirectGeneratorSuggestModeTypes" parse
@@ -5534,17 +5204,17 @@ instance FromJSON DirectGeneratorSuggestModeTypes where
5534 parse f = fail ("Unexpected DirectGeneratorSuggestModeTypes: " <> show f)
5204 parse f = fail ("Unexpected DirectGeneratorSuggestModeTypes: " <> show f)
5536data DirectGenerators = DirectGenerators
5206data DirectGenerators = DirectGenerators
5537− { directGeneratorsField :: FieldName
5207+ { directGeneratorsField :: FieldName
5538− , directGeneratorsSize :: Maybe Int
5208+ , directGeneratorsSize :: Maybe Int
5539− , directGeneratorSuggestMode :: DirectGeneratorSuggestModeTypes
5209+ , directGeneratorSuggestMode :: DirectGeneratorSuggestModeTypes
5540− , directGeneratorMaxEdits :: Maybe Double
5210+ , directGeneratorMaxEdits :: Maybe Double
5541− , directGeneratorPrefixLength :: Maybe Int
5211+ , directGeneratorPrefixLength :: Maybe Int
5542− , directGeneratorMinWordLength :: Maybe Int
5212+ , directGeneratorMinWordLength :: Maybe Int
5543 , directGeneratorMaxInspections :: Maybe Int
5213 , directGeneratorMaxInspections :: Maybe Int
5544− , directGeneratorMinDocFreq :: Maybe Double
5214+ , directGeneratorMinDocFreq :: Maybe Double
5545− , directGeneratorMaxTermFreq :: Maybe Double
5215+ , directGeneratorMaxTermFreq :: Maybe Double
5546− , directGeneratorPreFilter :: Maybe Text
5216+ , directGeneratorPreFilter :: Maybe Text
5547− , directGeneratorPostFilter :: Maybe Text
5217+ , directGeneratorPostFilter :: Maybe Text
5549 deriving (Show, Eq, Read, Generic, Typeable)
5219 deriving (Show, Eq, Read, Generic, Typeable)
@@ -5579,4 +5249,4 @@ instance FromJSON DirectGenerators where
5579 <*> o .:? "post_filter"
5249 <*> o .:? "post_filter"
5581mkDirectGenerators :: FieldName -> DirectGenerators
5251mkDirectGenerators :: FieldName -> DirectGenerators
5582−mkDirectGenerators fn = DirectGenerators fn Nothing DirectGeneratorSuggestModeMissing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
5252+mkDirectGenerators fn = DirectGenerators fn Nothing DirectGeneratorSuggestModeMissing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing