git.iko.soy/typeable/bloodhound
on master help sign in
Merge branch 'master' into directGenerators
f022a52Chris 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
bloodhound.cabal+1−1
@@ -55,7 +55,7 @@ library
55 text >= 0.11 && <1.3,
55 text >= 0.11 && <1.3,
56 mtl >= 1.0 && <2.3,
56 mtl >= 1.0 && <2.3,
57 transformers >= 0.2 && <0.6,
57 transformers >= 0.2 && <0.6,
58− http-types >= 0.8 && <0.11,
58+ http-types >= 0.8 && <0.13,
59 vector >= 0.10.9 && <0.13,
59 vector >= 0.10.9 && <0.13,
60 scientific >= 0.3.0.0 && <0.4.0.0,
60 scientific >= 0.3.0.0 && <0.4.0.0,
61 exceptions,
61 exceptions,
changelog.md+11
@@ -1,3 +1,14 @@
1+0.15.0.2
2+========
3+- @michaelxavier
4+ - Allow http-types 0.12
5+
6+0.15.0.1
7+========
8+- @bitemyapp
9+ - Allow http-types 0.11
10+ - Removed unused `oPath` function
11+
10.15.0.0
120.15.0.0
2===================
13===================
3
14
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/V5/Bloodhound/Client.hs+11−12
@@ -532,10 +532,6 @@ createIndexWith updates shards (IndexName indexName) =
532 )
532 )
533 ]
533 ]
534
534
535−oPath :: ToJSON a => NonEmpty Text -> a -> Value
536−oPath (k :| []) v = object [k .= v]
537−oPath (k:| (h:t)) v = object [k .= oPath (h :| t) v]
538−
539-- | 'deleteIndex' will delete an index given a 'Server', and an 'IndexName'.
535-- | 'deleteIndex' will delete an index given a 'Server', and an 'IndexName'.
540--
536--
541-- >>> _ <- runBH' $ createIndex defaultIndexSettings (IndexName "didimakeanindex")
537-- >>> _ <- runBH' $ createIndex defaultIndexSettings (IndexName "didimakeanindex")
@@ -703,14 +699,17 @@ listIndices :: (MonadThrow m, MonadBH m) => m [IndexName]
703listIndices =
699listIndices =
704 parse . responseBody =<< get =<< url
700 parse . responseBody =<< get =<< url
705 where
701 where
706− url = joinPath ["_cat/indices?v"]
702+ url = joinPath ["_cat/indices?format=json"]
707− -- parses the tabular format the indices api provides
703+ parse body = maybe (throwM (EsProtocolException body)) return $ do
708− parse body = case T.lines (T.decodeUtf8 (L.toStrict body)) of
704+ vals <- decode body
709− (hdr:rows) -> let ks = T.words hdr
705+ forM vals $ \val -> do
710− keyedRows = [ HM.fromList (zip ks (T.words row)) | row <- rows ]
706+ case val of
707+ Object obj -> do
711− names = catMaybes (HM.lookup "index" <$> keyedRows)
708+ indexVal <- HM.lookup "index" obj
712− in return (IndexName <$> names)
709+ case indexVal of
713− [] -> throwM (EsProtocolException body)
710+ String txt -> Just (IndexName txt)
711+ _ -> Nothing
712+ _ -> Nothing
714
713
715-- | 'updateIndexAliases' updates the server's index alias
714-- | 'updateIndexAliases' updates the server's index alias
716-- table. Operations are atomic. Explained in further detail at
715-- table. Operations are atomic. Explained in further detail at
stack-8.2.yaml+2−1
@@ -7,6 +7,7 @@ packages:
7 - './examples'
7 - './examples'
8
8
9extra-deps:
9extra-deps:
10−- quickcheck-properties-0.1
10+ - quickcheck-properties-0.1
11+ - http-types-0.12
11
12
12resolver: lts-10.0
13resolver: lts-10.0