git.iko.soy/typeable/bloodhound
on master help sign in
Merged with master, direct generators
c09b4e0Chris Allen
.travis.yml+2
@@ -20,6 +20,8 @@ env:
20 - GHCVER=8.0 ESVER=5.0.2 STACK_YAML=stack-8.0.yaml ESFLAG=ES5 DLINK=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch ES_JAVA_OPTS="-Xms500m -Xmx750m"
20 - GHCVER=8.0 ESVER=5.0.2 STACK_YAML=stack-8.0.yaml ESFLAG=ES5 DLINK=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch ES_JAVA_OPTS="-Xms500m -Xmx750m"
21 - GHCVER=8.2 ESVER=1.7.6 STACK_YAML=stack.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
21 - GHCVER=8.2 ESVER=1.7.6 STACK_YAML=stack.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
22 - GHCVER=8.2 ESVER=5.0.2 STACK_YAML=stack.yaml ESFLAG=ES5 DLINK=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch ES_JAVA_OPTS="-Xms500m -Xmx750m"
22 - GHCVER=8.2 ESVER=5.0.2 STACK_YAML=stack.yaml ESFLAG=ES5 DLINK=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch ES_JAVA_OPTS="-Xms500m -Xmx750m"
23+ - GHCVER=8.2 ESVER=5.5.0 STACK_YAML=stack.yaml ESFLAG=ES5 DLINK=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch ES_JAVA_OPTS="-Xms500m -Xmx750m"
24+ - GHCVER=8.2 ESVER=6.1.3 STACK_YAML=stack.yaml ESFLAG=ES5 DLINK=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch ES_JAVA_OPTS="-Xms500m -Xmx750m"
23
25
24install:
26install:
25 # stack
27 # stack
src/Database/V1/Bloodhound/Client.hs+11−8
@@ -583,14 +583,17 @@ listIndices :: (MonadThrow m, MonadBH m) => m [IndexName]
583listIndices =
583listIndices =
584 parse . responseBody =<< get =<< url
584 parse . responseBody =<< get =<< url
585 where
585 where
586− url = joinPath ["_cat/indices?v"]
586+ url = joinPath ["_cat/indices?format=json"]
587− -- parses the tabular format the indices api provides
587+ parse body = maybe (throwM (EsProtocolException body)) return $ do
588− parse body = case T.lines (T.decodeUtf8 (L.toStrict body)) of
588+ vals <- decode body
589− (hdr:rows) -> let ks = T.words hdr
589+ forM vals $ \val -> do
590− keyedRows = [ HM.fromList (zip ks (T.words row)) | row <- rows ]
590+ case val of
591+ Object obj -> do
591− names = catMaybes (HM.lookup "index" <$> keyedRows)
592+ indexVal <- HM.lookup "index" obj
592− in return (IndexName <$> names)
593+ case indexVal of
593− [] -> throwM (EsProtocolException body)
594+ String txt -> Just (IndexName txt)
595+ _ -> Nothing
596+ _ -> Nothing
594
597
595-- | 'updateIndexAliases' updates the server's index alias
598-- | 'updateIndexAliases' updates the server's index alias
596-- table. Operations are atomic. Explained in further detail at
599-- table. Operations are atomic. Explained in further detail at
src/Database/V1/Bloodhound/Types.hs+72−1
@@ -333,6 +333,9 @@ module Database.V1.Bloodhound.Types
333 , SuggestOptions(..)
333 , SuggestOptions(..)
334 , SuggestResponse(..)
334 , SuggestResponse(..)
335 , NamedSuggestionResponse(..)
335 , NamedSuggestionResponse(..)
336+ , DirectGenerators(..)
337+ , mkDirectGenerators
338+ , DirectGeneratorSuggestModeTypes (..)
336
339
337 , Aggregation(..)
340 , Aggregation(..)
338 , Aggregations
341 , Aggregations
@@ -5382,6 +5385,7 @@ data PhraseSuggester =
5382 , phraseSuggesterShardSize :: Maybe Int
5385 , phraseSuggesterShardSize :: Maybe Int
5383 , phraseSuggesterHighlight :: Maybe PhraseSuggesterHighlighter
5386 , phraseSuggesterHighlight :: Maybe PhraseSuggesterHighlighter
5384 , phraseSuggesterCollate :: Maybe PhraseSuggesterCollate
5387 , phraseSuggesterCollate :: Maybe PhraseSuggesterCollate
5388+ , phraseSuggesterCandidateGenerators :: [DirectGenerators]
5385 }
5389 }
5386 deriving (Show, Generic, Eq, Read, Typeable)
5390 deriving (Show, Generic, Eq, Read, Typeable)
5387
5391
@@ -5397,6 +5401,7 @@ instance ToJSON PhraseSuggester where
5397 , "shard_size" .= phraseSuggesterShardSize
5401 , "shard_size" .= phraseSuggesterShardSize
5398 , "highlight" .= phraseSuggesterHighlight
5402 , "highlight" .= phraseSuggesterHighlight
5399 , "collate" .= phraseSuggesterCollate
5403 , "collate" .= phraseSuggesterCollate
5404+ , "direct_generator" .= phraseSuggesterCandidateGenerators
5400 ]
5405 ]
5401
5406
5402instance FromJSON PhraseSuggester where
5407instance FromJSON PhraseSuggester where
@@ -5413,11 +5418,12 @@ instance FromJSON PhraseSuggester where
5413 <*> o .:? "shard_size"
5418 <*> o .:? "shard_size"
5414 <*> o .:? "highlight"
5419 <*> o .:? "highlight"
5415 <*> o .:? "collate"
5420 <*> o .:? "collate"
5421+ <*> o .:? "direct_generator" .!= []
5416
5422
5417mkPhraseSuggester :: FieldName -> PhraseSuggester
5423mkPhraseSuggester :: FieldName -> PhraseSuggester
5418mkPhraseSuggester fName =
5424mkPhraseSuggester fName =
5419 PhraseSuggester fName Nothing Nothing Nothing Nothing Nothing Nothing
5425 PhraseSuggester fName Nothing Nothing Nothing Nothing Nothing Nothing
5420− Nothing Nothing Nothing Nothing
5426+ Nothing Nothing Nothing Nothing []
5421
5427
5422data PhraseSuggesterHighlighter =
5428data PhraseSuggesterHighlighter =
5423 PhraseSuggesterHighlighter { phraseSuggesterHighlighterPreTag :: Text
5429 PhraseSuggesterHighlighter { phraseSuggesterHighlighterPreTag :: Text
@@ -5507,3 +5513,68 @@ instance FromJSON NamedSuggestionResponse where
5507 return $ NamedSuggestionResponse suggestionName' suggestionResponses'
5513 return $ NamedSuggestionResponse suggestionName' suggestionResponses'
5508
5514
5509 parseJSON x = typeMismatch "NamedSuggestionResponse" x
5515 parseJSON x = typeMismatch "NamedSuggestionResponse" x
5516+
5517+data DirectGeneratorSuggestModeTypes = DirectGeneratorSuggestModeMissing
5518+ | DirectGeneratorSuggestModePopular
5519+ | DirectGeneratorSuggestModeAlways
5520+ deriving (Show, Eq, Read, Generic, Typeable)
5521+
5522+instance ToJSON DirectGeneratorSuggestModeTypes where
5523+ toJSON DirectGeneratorSuggestModeMissing = "missing"
5524+ toJSON DirectGeneratorSuggestModePopular = "popular"
5525+ toJSON DirectGeneratorSuggestModeAlways = "always"
5526+
5527+instance FromJSON DirectGeneratorSuggestModeTypes where
5528+ parseJSON = withText "DirectGeneratorSuggestModeTypes" parse
5529+ where parse "missing" = pure DirectGeneratorSuggestModeMissing
5530+ parse "popular" = pure DirectGeneratorSuggestModePopular
5531+ parse "always" = pure DirectGeneratorSuggestModeAlways
5532+ parse f = fail ("Unexpected DirectGeneratorSuggestModeTypes: " <> show f)
5533+
5534+data DirectGenerators = DirectGenerators
5535+ { directGeneratorsField :: FieldName
5536+ , directGeneratorsSize :: Maybe Int
5537+ , directGeneratorSuggestMode :: DirectGeneratorSuggestModeTypes
5538+ , directGeneratorMaxEdits :: Maybe Double
5539+ , directGeneratorPrefixLength :: Maybe Int
5540+ , directGeneratorMinWordLength :: Maybe Int
5541+ , directGeneratorMaxInspections :: Maybe Int
5542+ , directGeneratorMinDocFreq :: Maybe Double
5543+ , directGeneratorMaxTermFreq :: Maybe Double
5544+ , directGeneratorPreFilter :: Maybe Text
5545+ , directGeneratorPostFilter :: Maybe Text
5546+ }
5547+ deriving (Show, Eq, Read, Generic, Typeable)
5548+
5549+
5550+instance ToJSON DirectGenerators where
5551+ toJSON DirectGenerators{..} = omitNulls [ "field" .= directGeneratorsField
5552+ , "size" .= directGeneratorsSize
5553+ , "suggest_mode" .= directGeneratorSuggestMode
5554+ , "max_edits" .= directGeneratorMaxEdits
5555+ , "prefix_length" .= directGeneratorPrefixLength
5556+ , "min_word_length" .= directGeneratorMinWordLength
5557+ , "max_inspections" .= directGeneratorMaxInspections
5558+ , "min_doc_freq" .= directGeneratorMinDocFreq
5559+ , "max_term_freq" .= directGeneratorMaxTermFreq
5560+ , "pre_filter" .= directGeneratorPreFilter
5561+ , "post_filter" .= directGeneratorPostFilter
5562+ ]
5563+
5564+instance FromJSON DirectGenerators where
5565+ parseJSON = withObject "DirectGenerators" parse
5566+ where parse o = DirectGenerators
5567+ <$> o .: "field"
5568+ <*> o .:? "size"
5569+ <*> o .: "suggest_mode"
5570+ <*> o .:? "max_edits"
5571+ <*> o .:? "prefix_length"
5572+ <*> o .:? "min_word_length"
5573+ <*> o .:? "max_inspections"
5574+ <*> o .:? "min_doc_freq"
5575+ <*> o .:? "max_term_freq"
5576+ <*> o .:? "pre_filter"
5577+ <*> o .:? "post_filter"
5578+
5579+mkDirectGenerators :: FieldName -> DirectGenerators
5580+mkDirectGenerators fn = DirectGenerators fn Nothing DirectGeneratorSuggestModeMissing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
src/Database/V5/Bloodhound/Client.hs+11−8
@@ -700,14 +700,17 @@ listIndices :: (MonadThrow m, MonadBH m) => m [IndexName]
700listIndices =
700listIndices =
701 parse . responseBody =<< get =<< url
701 parse . responseBody =<< get =<< url
702 where
702 where
703− url = joinPath ["_cat/indices?v"]
703+ url = joinPath ["_cat/indices?format=json"]
704− -- parses the tabular format the indices api provides
704+ parse body = maybe (throwM (EsProtocolException body)) return $ do
705− parse body = case T.lines (T.decodeUtf8 (L.toStrict body)) of
705+ vals <- decode body
706− (hdr:rows) -> let ks = T.words hdr
706+ forM vals $ \val -> do
707− keyedRows = [ HM.fromList (zip ks (T.words row)) | row <- rows ]
707+ case val of
708+ Object obj -> do
708− names = catMaybes (HM.lookup "index" <$> keyedRows)
709+ indexVal <- HM.lookup "index" obj
709− in return (IndexName <$> names)
710+ case indexVal of
710− [] -> throwM (EsProtocolException body)
711+ String txt -> Just (IndexName txt)
712+ _ -> Nothing
713+ _ -> Nothing
711
714
712-- | 'updateIndexAliases' updates the server's index alias
715-- | 'updateIndexAliases' updates the server's index alias
713-- table. Operations are atomic. Explained in further detail at
716-- table. Operations are atomic. Explained in further detail at
src/Database/V5/Bloodhound/Types.hs+73−42
@@ -1,5 +1,3 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
2−{-# LANGUAGE DeriveGeneric #-}
3{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE GeneralizedNewtypeDeriving #-}
3{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -16,7 +14,7 @@
16-- License : BSD-style (see the file LICENSE)
14-- License : BSD-style (see the file LICENSE)
17-- Maintainer : Chris Allen <cma@bitemyapp.com
15-- Maintainer : Chris Allen <cma@bitemyapp.com
18-- Stability : provisional
16-- Stability : provisional
19−-- Portability : DeriveGeneric, RecordWildCards
17+-- Portability : RecordWildCards
20--
18--
21-- Data types for describing actions and data structures performed to interact
19-- Data types for describing actions and data structures performed to interact
22-- with Elasticsearch. The two main buckets your queries against Elasticsearch
20-- with Elasticsearch. The two main buckets your queries against Elasticsearch
@@ -357,6 +355,9 @@ module Database.V5.Bloodhound.Types
357 , SuggestOptions(..)
355 , SuggestOptions(..)
358 , SuggestResponse(..)
356 , SuggestResponse(..)
359 , NamedSuggestionResponse(..)
357 , NamedSuggestionResponse(..)
358+ , DirectGenerators(..)
359+ , mkDirectGenerators
360+ , DirectGeneratorSuggestModeTypes (..)
360
361
361 , Aggregation(..)
362 , Aggregation(..)
362 , Aggregations
363 , Aggregations
@@ -407,44 +408,6 @@ module Database.V5.Bloodhound.Types
407 , TokenChar(..)
408 , TokenChar(..)
408 ) where
409 ) where
409
410
410−-- import Control.Applicative as A
411−-- import Control.Arrow (first)
412−-- import Control.Monad.Catch
413−-- import Control.Monad.Except
414−-- import Control.Monad.State (MonadState)
415−-- import Control.Monad.Writer (MonadWriter)
416−-- import Data.Aeson
417−-- import Data.Aeson.Types (Pair, Parser,
418−-- emptyObject,
419−-- parseEither, parseMaybe,
420−-- typeMismatch)
421−-- import qualified Data.ByteString.Lazy.Char8 as L
422−-- import Data.Char
423−-- import Data.Hashable (Hashable)
424−-- import qualified Data.HashMap.Strict as HM
425−-- import Data.List (foldl', intercalate,
426−-- nub)
427−-- import Data.List.NonEmpty (NonEmpty (..), toList)
428−-- import Data.Maybe
429−-- import Data.Scientific (Scientific)
430−-- import Data.Semigroup
431−-- import Data.Text (Text)
432−-- import qualified Data.Text as T
433−-- import Data.Time.Calendar
434−-- import Data.Time.Clock (NominalDiffTime,
435−-- UTCTime)
436−-- import Data.Time.Clock.POSIX
437−-- import qualified Data.Traversable as DT
438−-- import Data.Typeable (Typeable)
439−-- import qualified Data.Vector as V
440−-- import qualified Data.Version as Vers
441−-- import GHC.Enum
442−-- import GHC.Generics (Generic)
443−-- import Network.HTTP.Client
444−-- import qualified Network.HTTP.Types.Method as NHTM
445−-- import qualified Text.ParserCombinators.ReadP as RP
446−-- import qualified Text.Read as TR
447−
448import Bloodhound.Import
411import Bloodhound.Import
449
412
450import qualified Data.Traversable as DT
413import qualified Data.Traversable as DT
@@ -1659,6 +1622,7 @@ data PhraseSuggester =
1659 , phraseSuggesterShardSize :: Maybe Int
1622 , phraseSuggesterShardSize :: Maybe Int
1660 , phraseSuggesterHighlight :: Maybe PhraseSuggesterHighlighter
1623 , phraseSuggesterHighlight :: Maybe PhraseSuggesterHighlighter
1661 , phraseSuggesterCollate :: Maybe PhraseSuggesterCollate
1624 , phraseSuggesterCollate :: Maybe PhraseSuggesterCollate
1625+ , phraseSuggesterCandidateGenerators :: [DirectGenerators]
1662 }
1626 }
1663 deriving (Eq, Show)
1627 deriving (Eq, Show)
1664
1628
@@ -1674,6 +1638,7 @@ instance ToJSON PhraseSuggester where
1674 , "shard_size" .= phraseSuggesterShardSize
1638 , "shard_size" .= phraseSuggesterShardSize
1675 , "highlight" .= phraseSuggesterHighlight
1639 , "highlight" .= phraseSuggesterHighlight
1676 , "collate" .= phraseSuggesterCollate
1640 , "collate" .= phraseSuggesterCollate
1641+ , "direct_generator" .= phraseSuggesterCandidateGenerators
1677 ]
1642 ]
1678
1643
1679instance FromJSON PhraseSuggester where
1644instance FromJSON PhraseSuggester where
@@ -1690,11 +1655,12 @@ instance FromJSON PhraseSuggester where
1690 <*> o .:? "shard_size"
1655 <*> o .:? "shard_size"
1691 <*> o .:? "highlight"
1656 <*> o .:? "highlight"
1692 <*> o .:? "collate"
1657 <*> o .:? "collate"
1658+ <*> o .:? "direct_generator" .!= []
1693
1659
1694mkPhraseSuggester :: FieldName -> PhraseSuggester
1660mkPhraseSuggester :: FieldName -> PhraseSuggester
1695mkPhraseSuggester fName =
1661mkPhraseSuggester fName =
1696 PhraseSuggester fName Nothing Nothing Nothing Nothing Nothing Nothing
1662 PhraseSuggester fName Nothing Nothing Nothing Nothing Nothing Nothing
1697− Nothing Nothing Nothing Nothing
1663+ Nothing Nothing Nothing Nothing []
1698
1664
1699data PhraseSuggesterHighlighter =
1665data PhraseSuggesterHighlighter =
1700 PhraseSuggesterHighlighter { phraseSuggesterHighlighterPreTag :: Text
1666 PhraseSuggesterHighlighter { phraseSuggesterHighlighterPreTag :: Text
@@ -1784,3 +1750,68 @@ instance FromJSON NamedSuggestionResponse where
1784 return $ NamedSuggestionResponse suggestionName' suggestionResponses'
1750 return $ NamedSuggestionResponse suggestionName' suggestionResponses'
1785
1751
1786 parseJSON x = typeMismatch "NamedSuggestionResponse" x
1752 parseJSON x = typeMismatch "NamedSuggestionResponse" x
1753+
1754+data DirectGeneratorSuggestModeTypes = DirectGeneratorSuggestModeMissing
1755+ | DirectGeneratorSuggestModePopular
1756+ | DirectGeneratorSuggestModeAlways
1757+ deriving (Eq, Show)
1758+
1759+instance ToJSON DirectGeneratorSuggestModeTypes where
1760+ toJSON DirectGeneratorSuggestModeMissing = "missing"
1761+ toJSON DirectGeneratorSuggestModePopular = "popular"
1762+ toJSON DirectGeneratorSuggestModeAlways = "always"
1763+
1764+instance FromJSON DirectGeneratorSuggestModeTypes where
1765+ parseJSON = withText "DirectGeneratorSuggestModeTypes" parse
1766+ where parse "missing" = pure DirectGeneratorSuggestModeMissing
1767+ parse "popular" = pure DirectGeneratorSuggestModePopular
1768+ parse "always" = pure DirectGeneratorSuggestModeAlways
1769+ parse f = fail ("Unexpected DirectGeneratorSuggestModeTypes: " <> show f)
1770+
1771+data DirectGenerators = DirectGenerators
1772+ { directGeneratorsField :: FieldName
1773+ , directGeneratorsSize :: Maybe Int
1774+ , directGeneratorSuggestMode :: DirectGeneratorSuggestModeTypes
1775+ , directGeneratorMaxEdits :: Maybe Double
1776+ , directGeneratorPrefixLength :: Maybe Int
1777+ , directGeneratorMinWordLength :: Maybe Int
1778+ , directGeneratorMaxInspections :: Maybe Int
1779+ , directGeneratorMinDocFreq :: Maybe Double
1780+ , directGeneratorMaxTermFreq :: Maybe Double
1781+ , directGeneratorPreFilter :: Maybe Text
1782+ , directGeneratorPostFilter :: Maybe Text
1783+ }
1784+ deriving (Eq, Show)
1785+
1786+
1787+instance ToJSON DirectGenerators where
1788+ toJSON DirectGenerators{..} = omitNulls [ "field" .= directGeneratorsField
1789+ , "size" .= directGeneratorsSize
1790+ , "suggest_mode" .= directGeneratorSuggestMode
1791+ , "max_edits" .= directGeneratorMaxEdits
1792+ , "prefix_length" .= directGeneratorPrefixLength
1793+ , "min_word_length" .= directGeneratorMinWordLength
1794+ , "max_inspections" .= directGeneratorMaxInspections
1795+ , "min_doc_freq" .= directGeneratorMinDocFreq
1796+ , "max_term_freq" .= directGeneratorMaxTermFreq
1797+ , "pre_filter" .= directGeneratorPreFilter
1798+ , "post_filter" .= directGeneratorPostFilter
1799+ ]
1800+
1801+instance FromJSON DirectGenerators where
1802+ parseJSON = withObject "DirectGenerators" parse
1803+ where parse o = DirectGenerators
1804+ <$> o .: "field"
1805+ <*> o .:? "size"
1806+ <*> o .: "suggest_mode"
1807+ <*> o .:? "max_edits"
1808+ <*> o .:? "prefix_length"
1809+ <*> o .:? "min_word_length"
1810+ <*> o .:? "max_inspections"
1811+ <*> o .:? "min_doc_freq"
1812+ <*> o .:? "max_term_freq"
1813+ <*> o .:? "pre_filter"
1814+ <*> o .:? "post_filter"
1815+
1816+mkDirectGenerators :: FieldName -> DirectGenerators
1817+mkDirectGenerators fn = DirectGenerators fn Nothing DirectGeneratorSuggestModeMissing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
stack-8.2.yaml+1
@@ -7,6 +7,7 @@ packages:
7 - './examples'
7 - './examples'
8
8
9extra-deps:
9extra-deps:
10+ - quickcheck-properties-0.1
10 - http-types-0.12
11 - http-types-0.12
11 - quickcheck-arbitrary-template-0.2.0.0
12 - quickcheck-arbitrary-template-0.2.0.0
12
13
tests/V1/tests.hs+6
@@ -607,6 +607,8 @@ instance ApproxEq PhraseSuggesterCollate
607instance ApproxEq PhraseSuggester
607instance ApproxEq PhraseSuggester
608instance ApproxEq SuggestType
608instance ApproxEq SuggestType
609instance ApproxEq Suggest
609instance ApproxEq Suggest
610+instance ApproxEq DirectGenerators
611+instance ApproxEq DirectGeneratorSuggestModeTypes
610
612
611-- | Due to the way nodeattrfilters get serialized here, they may come
613-- | Due to the way nodeattrfilters get serialized here, they may come
612-- out in a different order, but they are morally equivalent
614-- out in a different order, but they are morally equivalent
@@ -948,6 +950,8 @@ instance Arbitrary Size where arbitrary = sopArbitrary; shrink = genericShrink
948instance Arbitrary PhraseSuggester where arbitrary = sopArbitrary; shrink = genericShrink
950instance Arbitrary PhraseSuggester where arbitrary = sopArbitrary; shrink = genericShrink
949instance Arbitrary SuggestType where arbitrary = sopArbitrary; shrink = genericShrink
951instance Arbitrary SuggestType where arbitrary = sopArbitrary; shrink = genericShrink
950instance Arbitrary Suggest where arbitrary = sopArbitrary; shrink = genericShrink
952instance Arbitrary Suggest where arbitrary = sopArbitrary; shrink = genericShrink
953+instance Arbitrary DirectGenerators where arbitrary = sopArbitrary; shrink = genericShrink
954+instance Arbitrary DirectGeneratorSuggestModeTypes where arbitrary = sopArbitrary; shrink = genericShrink
951
955
952newtype UpdatableIndexSetting' = UpdatableIndexSetting' UpdatableIndexSetting
956newtype UpdatableIndexSetting' = UpdatableIndexSetting' UpdatableIndexSetting
953 deriving (Show, Eq, ToJSON, FromJSON, ApproxEq, Typeable)
957 deriving (Show, Eq, ToJSON, FromJSON, ApproxEq, Typeable)
@@ -1944,6 +1948,8 @@ main = hspec $ do
1944 propJSON (Proxy :: Proxy CompoundFormat)
1948 propJSON (Proxy :: Proxy CompoundFormat)
1945 propJSON (Proxy :: Proxy TemplateQueryInline)
1949 propJSON (Proxy :: Proxy TemplateQueryInline)
1946 propJSON (Proxy :: Proxy Suggest)
1950 propJSON (Proxy :: Proxy Suggest)
1951+ propJSON (Proxy :: Proxy DirectGenerators)
1952+ propJSON (Proxy :: Proxy DirectGeneratorSuggestModeTypes)
1947
1953
1948-- Temporary solution for lacking of generic derivation of Arbitrary
1954-- Temporary solution for lacking of generic derivation of Arbitrary
1949-- We use generics-sop, as it's much more concise than directly using GHC.Generics
1955-- We use generics-sop, as it's much more concise than directly using GHC.Generics
tests/V5/tests.hs+7
@@ -952,6 +952,10 @@ makeArbitrary ''SnapshotRepoName
952instance Arbitrary SnapshotRepoName where arbitrary = arbitrarySnapshotRepoName
952instance Arbitrary SnapshotRepoName where arbitrary = arbitrarySnapshotRepoName
953makeArbitrary ''TemplateQueryInline
953makeArbitrary ''TemplateQueryInline
954instance Arbitrary TemplateQueryInline where arbitrary = arbitraryTemplateQueryInline
954instance Arbitrary TemplateQueryInline where arbitrary = arbitraryTemplateQueryInline
955+makeArbitrary ''DirectGeneratorSuggestModeTypes
956+instance Arbitrary DirectGeneratorSuggestModeTypes where arbitrary = arbitraryDirectGeneratorSuggestModeTypes
957+makeArbitrary ''DirectGenerators
958+instance Arbitrary DirectGenerators where arbitrary = arbitraryDirectGenerators
955makeArbitrary ''PhraseSuggesterCollate
959makeArbitrary ''PhraseSuggesterCollate
956instance Arbitrary PhraseSuggesterCollate where arbitrary = arbitraryPhraseSuggesterCollate
960instance Arbitrary PhraseSuggesterCollate where arbitrary = arbitraryPhraseSuggesterCollate
957makeArbitrary ''PhraseSuggesterHighlighter
961makeArbitrary ''PhraseSuggesterHighlighter
@@ -1959,6 +1963,9 @@ main = hspec $ do
1959 propJSON (Proxy :: Proxy CompoundFormat)
1963 propJSON (Proxy :: Proxy CompoundFormat)
1960 propJSON (Proxy :: Proxy TemplateQueryInline)
1964 propJSON (Proxy :: Proxy TemplateQueryInline)
1961 propJSON (Proxy :: Proxy Suggest)
1965 propJSON (Proxy :: Proxy Suggest)
1966+ propJSON (Proxy :: Proxy DirectGenerators)
1967+ propJSON (Proxy :: Proxy DirectGeneratorSuggestModeTypes)
1968+
1962 describe "Approximate isomorphism JSON instances" $ do
1969 describe "Approximate isomorphism JSON instances" $ do
1963 propApproxJSON (Proxy :: Proxy UpdatableIndexSetting')
1970 propApproxJSON (Proxy :: Proxy UpdatableIndexSetting')
1964 propApproxJSON (Proxy :: Proxy ReplicaCount)
1971 propApproxJSON (Proxy :: Proxy ReplicaCount)