git.iko.soy/typeable/bloodhound
on master help sign in
Fix typo: ElasticSearch -> Elasticsearch
ee1b51eYusuke Miyazaki
DSL.org+1−1
@@ -1,4 +1,4 @@
1−* ElasticSearch DSL
1+* Elasticsearch DSL
2
2
3** Grouping
3** Grouping
4
4
README.md+7−7
@@ -22,17 +22,17 @@ Version compatibility
22---------------------
22---------------------
23
23
24As of version 0.13.0.0, Bloodhound has 2 separate module trees for
24As of version 0.13.0.0, Bloodhound has 2 separate module trees for
25−ElasticSearch versions 1 and 5. Import the module that is appropriate
25+Elasticsearch versions 1 and 5. Import the module that is appropriate
26for your use case. If you would like to add support for another major
26for your use case. If you would like to add support for another major
27version, open a ticket expressing your intend and follow the pattern
27version, open a ticket expressing your intend and follow the pattern
28used for other versions. We weighed the idea of sharing code between
28used for other versions. We weighed the idea of sharing code between
29versions but it just got too messy, especially considering the
29versions but it just got too messy, especially considering the
30−instability of the ElasticSearch API. We switched to a model which
30+instability of the Elasticsearch API. We switched to a model which
31would allow the persons responsible for a particular protocol version
31would allow the persons responsible for a particular protocol version
32to maintain that version while avoiding conflict with other versions.
32to maintain that version while avoiding conflict with other versions.
33
33
34See our [TravisCI](https://travis-ci.org/bitemyapp/bloodhound) for a
34See our [TravisCI](https://travis-ci.org/bitemyapp/bloodhound) for a
35−listing of ElasticSearch version we test against.
35+listing of Elasticsearch version we test against.
36
36
37
37
38Stability
38Stability
@@ -43,15 +43,15 @@ Bloodhound is stable for production use. I will strive to avoid breaking API com
43Testing
43Testing
44---------
44---------
45
45
46−The TravisCI tests are run using [Stack](http://docs.haskellstack.org/en/stable/README.html). You should use Stack instead of `cabal` to build and test Bloodhound to avoid compatibility problems. You will also need to have an ElasticSearch instance running at `localhost:9200` in order to execute some of the tests. See the "Version compatibility" section above for a list of ElasticSearch versions that are officially validated against in TravisCI.
46+The TravisCI tests are run using [Stack](http://docs.haskellstack.org/en/stable/README.html). You should use Stack instead of `cabal` to build and test Bloodhound to avoid compatibility problems. You will also need to have an Elasticsearch instance running at `localhost:9200` in order to execute some of the tests. See the "Version compatibility" section above for a list of Elasticsearch versions that are officially validated against in TravisCI.
47
47
48Steps to run the tests locally:
48Steps to run the tests locally:
49− 1. Dig through the [past releases] (https://www.elastic.co/downloads/past-releases) section of the ElasticSearch download page and install the desired ElasticSearch versions.
49+ 1. Dig through the [past releases] (https://www.elastic.co/downloads/past-releases) section of the Elasticsearch download page and install the desired Elasticsearch versions.
50 2. Install [Stack] (http://docs.haskellstack.org/en/stable/README.html#how-to-install)
50 2. Install [Stack] (http://docs.haskellstack.org/en/stable/README.html#how-to-install)
51 3. In your local Bloodhound directory, run `stack setup && stack build`
51 3. In your local Bloodhound directory, run `stack setup && stack build`
52− 4. Start the desired version of ElasticSearch at `localhost:9200`, which should be the default.
52+ 4. Start the desired version of Elasticsearch at `localhost:9200`, which should be the default.
53 5. Run `stack test` in your local Bloodhound directory.
53 5. Run `stack test` in your local Bloodhound directory.
54− 6. The unit tests will pass if you re-execute `stack test`. If you want to start with a clean slate, stop your ElasticSearch instance, delete the `data/` folder in the ElasticSearch installation, restart ElasticSearch, and re-run `stack test`.
54+ 6. The unit tests will pass if you re-execute `stack test`. If you want to start with a clean slate, stop your Elasticsearch instance, delete the `data/` folder in the Elasticsearch installation, restart Elasticsearch, and re-run `stack test`.
55
55
56
56
57Hackage page and Haddock documentation
57Hackage page and Haddock documentation
bloodhound.cabal+2−2
@@ -1,7 +1,7 @@
1name: bloodhound
1name: bloodhound
2version: 0.16.0.0
2version: 0.16.0.0
3−synopsis: ElasticSearch client library for Haskell
3+synopsis: Elasticsearch client library for Haskell
4−description: ElasticSearch made awesome for Haskell hackers
4+description: Elasticsearch made awesome for Haskell hackers
5homepage: https://github.com/bitemyapp/bloodhound
5homepage: https://github.com/bitemyapp/bloodhound
6license: BSD3
6license: BSD3
7license-file: LICENSE
7license-file: LICENSE
examples/README.md+1−1
@@ -1,6 +1,6 @@
1# Bloodhound Examples
1# Bloodhound Examples
2
2
3These examples can be built via `stack build`.
3These examples can be built via `stack build`.
4−To run them start an ElasticSearch 5.x server at `localhost:9200`
4+To run them start an Elasticsearch 5.x server at `localhost:9200`
5
5
6Run with `stack exec tweet-example`
6Run with `stack exec tweet-example`
src/Database/V1/Bloodhound/Client.hs+3−3
@@ -281,7 +281,7 @@ updateSnapshotRepo SnapshotRepoUpdateSettings {..} repo =
281
281
282
282
283-- | Verify if a snapshot repo is working. __NOTE:__ this API did not
283-- | Verify if a snapshot repo is working. __NOTE:__ this API did not
284−-- make it into ElasticSearch until 1.4. If you use an older version,
284+-- make it into Elasticsearch until 1.4. If you use an older version,
285-- you will get an error here.
285-- you will get an error here.
286verifySnapshotRepo
286verifySnapshotRepo
287 :: ( MonadBH m
287 :: ( MonadBH m
@@ -479,7 +479,7 @@ getIndexSettings (IndexName indexName) = do
479-- to True is the main way to release disk space back to the OS being
479-- to True is the main way to release disk space back to the OS being
480-- held by deleted documents.
480-- held by deleted documents.
481--
481--
482−-- Note that this API was deprecated in ElasticSearch 2.1 for the
482+-- Note that this API was deprecated in Elasticsearch 2.1 for the
483-- almost completely identical forcemerge API. Adding support to that
483-- almost completely identical forcemerge API. Adding support to that
484-- API would be trivial but due to the significant breaking changes,
484-- API would be trivial but due to the significant breaking changes,
485-- this library cannot currently be used with >= 2.0, so that feature was omitted.
485-- this library cannot currently be used with >= 2.0, so that feature was omitted.
@@ -520,7 +520,7 @@ existentialQuery url = do
520-- responses from elasticsearch should fall into these two
520-- responses from elasticsearch should fall into these two
521-- categories. If they don't, a 'EsProtocolException' will be
521-- categories. If they don't, a 'EsProtocolException' will be
522-- thrown. If you encounter this, please report the full body it
522-- thrown. If you encounter this, please report the full body it
523−-- reports along with your ElasticSearch verison.
523+-- reports along with your Elasticsearch verison.
524parseEsResponse :: (MonadThrow m, FromJSON a) => Reply
524parseEsResponse :: (MonadThrow m, FromJSON a) => Reply
525 -> m (Either EsError a)
525 -> m (Either EsError a)
526parseEsResponse reply
526parseEsResponse reply
src/Database/V1/Bloodhound/Types.hs+7−7
@@ -525,7 +525,7 @@ data IndexOptimizationSettings =
525
525
526
526
527{-| 'defaultIndexOptimizationSettings' implements the default settings that
527{-| 'defaultIndexOptimizationSettings' implements the default settings that
528− ElasticSearch uses for index optimization. 'maxNumSegments' is Nothing,
528+ Elasticsearch uses for index optimization. 'maxNumSegments' is Nothing,
529 'onlyExpungeDeletes' is False, and flushAfterOptimize is True.
529 'onlyExpungeDeletes' is False, and flushAfterOptimize is True.
530-}
530-}
531defaultIndexOptimizationSettings :: IndexOptimizationSettings
531defaultIndexOptimizationSettings :: IndexOptimizationSettings
@@ -736,11 +736,11 @@ data EsError = EsError { errorStatus :: Int
736 , errorMessage :: Text } deriving (Eq, Read, Show, Generic, Typeable)
736 , errorMessage :: Text } deriving (Eq, Read, Show, Generic, Typeable)
737
737
738{-| 'EsProtocolException' will be thrown if Bloodhound cannot parse a response
738{-| 'EsProtocolException' will be thrown if Bloodhound cannot parse a response
739−returned by the ElasticSearch server. If you encounter this error, please
739+returned by the Elasticsearch server. If you encounter this error, please
740verify that your domain data types and FromJSON instances are working properly
740verify that your domain data types and FromJSON instances are working properly
741(for example, the 'a' of '[Hit a]' in 'SearchResult.searchHits.hits'). If you're
741(for example, the 'a' of '[Hit a]' in 'SearchResult.searchHits.hits'). If you're
742sure that your mappings are correct, then this error may be an indication of an
742sure that your mappings are correct, then this error may be an indication of an
743−incompatibility between Bloodhound and ElasticSearch. Please open a bug report
743+incompatibility between Bloodhound and Elasticsearch. Please open a bug report
744and be sure to include the exception body.
744and be sure to include the exception body.
745-}
745-}
746data EsProtocolException = EsProtocolException { esProtoExBody :: L.ByteString }
746data EsProtocolException = EsProtocolException { esProtoExBody :: L.ByteString }
@@ -3980,7 +3980,7 @@ newtype FullNodeId = FullNodeId { fullNodeId :: Text }
3980
3980
3981
3981
3982-- | A human-readable node name that is supplied by the user in the
3982-- | A human-readable node name that is supplied by the user in the
3983−-- node config or automatically generated by ElasticSearch.
3983+-- node config or automatically generated by Elasticsearch.
3984newtype NodeName = NodeName { nodeName :: Text }
3984newtype NodeName = NodeName { nodeName :: Text }
3985 deriving (Eq, Ord, Generic, Show, Typeable, FromJSON)
3985 deriving (Eq, Ord, Generic, Show, Typeable, FromJSON)
3986
3986
@@ -4266,7 +4266,7 @@ data NodeIndicesStats = NodeIndicesStats {
4266 , nodeIndicesStatsDocsCount :: Int
4266 , nodeIndicesStatsDocsCount :: Int
4267 } deriving (Eq, Show, Generic, Typeable)
4267 } deriving (Eq, Show, Generic, Typeable)
4268
4268
4269−-- | A quirky address format used throughout ElasticSearch. An example
4269+-- | A quirky address format used throughout Elasticsearch. An example
4270-- would be inet[/1.1.1.1:9200]. inet may be a placeholder for a
4270-- would be inet[/1.1.1.1:9200]. inet may be a placeholder for a
4271-- <https://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN>.
4271-- <https://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN>.
4272newtype EsAddress = EsAddress { esAddress :: Text }
4272newtype EsAddress = EsAddress { esAddress :: Text }
@@ -4459,7 +4459,7 @@ defaultSnapshotRepoUpdateSettings = SnapshotRepoUpdateSettings True
4459
4459
4460
4460
4461-- | A filesystem-based snapshot repo that ships with
4461-- | A filesystem-based snapshot repo that ships with
4462−-- ElasticSearch. This is an instance of 'SnapshotRepo' so it can be
4462+-- Elasticsearch. This is an instance of 'SnapshotRepo' so it can be
4463-- used with 'updateSnapshotRepo'
4463-- used with 'updateSnapshotRepo'
4464data FsSnapshotRepo = FsSnapshotRepo {
4464data FsSnapshotRepo = FsSnapshotRepo {
4465 fsrName :: SnapshotRepoName
4465 fsrName :: SnapshotRepoName
@@ -4704,7 +4704,7 @@ newtype RestoreRenamePattern = RestoreRenamePattern { rrPattern :: Text }
4704
4704
4705-- | A single token in a index renaming scheme for a restore. These
4705-- | A single token in a index renaming scheme for a restore. These
4706-- are concatenated into a string before being sent to
4706-- are concatenated into a string before being sent to
4707−-- ElasticSearch. Check out these Java
4707+-- Elasticsearch. Check out these Java
4708-- <https://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html docs> to find out more if you're into that sort of thing.
4708-- <https://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html docs> to find out more if you're into that sort of thing.
4709data RestoreRenameToken = RRTLit Text
4709data RestoreRenameToken = RRTLit Text
4710 -- ^ Just a literal string of characters
4710 -- ^ Just a literal string of characters
src/Database/V5/Bloodhound/Client.hs+3−3
@@ -345,7 +345,7 @@ updateSnapshotRepo SnapshotRepoUpdateSettings {..} repo =
345
345
346
346
347-- | Verify if a snapshot repo is working. __NOTE:__ this API did not
347-- | Verify if a snapshot repo is working. __NOTE:__ this API did not
348−-- make it into ElasticSearch until 1.4. If you use an older version,
348+-- make it into Elasticsearch until 1.4. If you use an older version,
349-- you will get an error here.
349-- you will get an error here.
350verifySnapshotRepo
350verifySnapshotRepo
351 :: ( MonadBH m
351 :: ( MonadBH m
@@ -628,7 +628,7 @@ existentialQuery url = do
628-- responses from elasticsearch should fall into these two
628-- responses from elasticsearch should fall into these two
629-- categories. If they don't, a 'EsProtocolException' will be
629-- categories. If they don't, a 'EsProtocolException' will be
630-- thrown. If you encounter this, please report the full body it
630-- thrown. If you encounter this, please report the full body it
631−-- reports along with your ElasticSearch verison.
631+-- reports along with your Elasticsearch verison.
632parseEsResponse :: (MonadThrow m, FromJSON a) => Reply
632parseEsResponse :: (MonadThrow m, FromJSON a) => Reply
633 -> m (Either EsError a)
633 -> m (Either EsError a)
634parseEsResponse reply
634parseEsResponse reply
@@ -810,7 +810,7 @@ versionCtlParams cfg =
810-- Elasticsearch. The document itself is simply something we can
810-- Elasticsearch. The document itself is simply something we can
811-- convert into a JSON 'Value'. The 'DocId' will function as the
811-- convert into a JSON 'Value'. The 'DocId' will function as the
812-- primary key for the document. You are encouraged to generate
812-- primary key for the document. You are encouraged to generate
813−-- your own id's and not rely on ElasticSearch's automatic id
813+-- your own id's and not rely on Elasticsearch's automatic id
814-- generation. Read more about it here:
814-- generation. Read more about it here:
815-- https://github.com/bitemyapp/bloodhound/issues/107
815-- https://github.com/bitemyapp/bloodhound/issues/107
816--
816--
src/Database/V5/Bloodhound/Types.hs+10−10
@@ -539,7 +539,7 @@ data ForceMergeIndexSettings =
539
539
540
540
541{-| 'defaultForceMergeIndexSettings' implements the default settings that
541{-| 'defaultForceMergeIndexSettings' implements the default settings that
542− ElasticSearch uses for index optimization. 'maxNumSegments' is Nothing,
542+ Elasticsearch uses for index optimization. 'maxNumSegments' is Nothing,
543 'onlyExpungeDeletes' is False, and flushAfterOptimize is True.
543 'onlyExpungeDeletes' is False, and flushAfterOptimize is True.
544-}
544-}
545defaultForceMergeIndexSettings :: ForceMergeIndexSettings
545defaultForceMergeIndexSettings :: ForceMergeIndexSettings
@@ -700,10 +700,10 @@ instance FromJSON TokenFilterDefinition where
700 _ -> fail ("unrecognized token filter type: " ++ T.unpack t)
700 _ -> fail ("unrecognized token filter type: " ++ T.unpack t)
701
701
702-- | The set of languages that can be passed to various analyzers,
702-- | The set of languages that can be passed to various analyzers,
703−-- filters, etc. in ElasticSearch. Most data types in this module
703+-- filters, etc. in Elasticsearch. Most data types in this module
704-- that have a 'Language' field are actually only actually to
704-- that have a 'Language' field are actually only actually to
705-- handle a subset of these languages. Consult the official
705-- handle a subset of these languages. Consult the official
706−-- ElasticSearch documentation to see what is actually supported.
706+-- Elasticsearch documentation to see what is actually supported.
707data Language
707data Language
708 = Arabic
708 = Arabic
709 | Armenian
709 | Armenian
@@ -750,7 +750,7 @@ instance ToJSON Language where
750
750
751instance FromJSON Language where
751instance FromJSON Language where
752 parseJSON = withText "Language" $ \t -> case languageFromText t of
752 parseJSON = withText "Language" $ \t -> case languageFromText t of
753− Nothing -> fail "not a supported ElasticSearch language"
753+ Nothing -> fail "not a supported Elasticsearch language"
754 Just lang -> return lang
754 Just lang -> return lang
755
755
756languageToText :: Language -> Text
756languageToText :: Language -> Text
@@ -1066,11 +1066,11 @@ data EsError = EsError { errorStatus :: Int
1066 , errorMessage :: Text } deriving (Eq, Read, Show, Generic, Typeable)
1066 , errorMessage :: Text } deriving (Eq, Read, Show, Generic, Typeable)
1067
1067
1068{-| 'EsProtocolException' will be thrown if Bloodhound cannot parse a response
1068{-| 'EsProtocolException' will be thrown if Bloodhound cannot parse a response
1069−returned by the ElasticSearch server. If you encounter this error, please
1069+returned by the Elasticsearch server. If you encounter this error, please
1070verify that your domain data types and FromJSON instances are working properly
1070verify that your domain data types and FromJSON instances are working properly
1071(for example, the 'a' of '[Hit a]' in 'SearchResult.searchHits.hits'). If you're
1071(for example, the 'a' of '[Hit a]' in 'SearchResult.searchHits.hits'). If you're
1072sure that your mappings are correct, then this error may be an indication of an
1072sure that your mappings are correct, then this error may be an indication of an
1073−incompatibility between Bloodhound and ElasticSearch. Please open a bug report
1073+incompatibility between Bloodhound and Elasticsearch. Please open a bug report
1074and be sure to include the exception body.
1074and be sure to include the exception body.
1075-}
1075-}
1076data EsProtocolException = EsProtocolException { esProtoExBody :: L.ByteString }
1076data EsProtocolException = EsProtocolException { esProtoExBody :: L.ByteString }
@@ -4131,7 +4131,7 @@ newtype FullNodeId = FullNodeId { fullNodeId :: Text }
4131
4131
4132
4132
4133-- | A human-readable node name that is supplied by the user in the
4133-- | A human-readable node name that is supplied by the user in the
4134−-- node config or automatically generated by ElasticSearch.
4134+-- node config or automatically generated by Elasticsearch.
4135newtype NodeName = NodeName { nodeName :: Text }
4135newtype NodeName = NodeName { nodeName :: Text }
4136 deriving (Eq, Ord, Generic, Show, Typeable, FromJSON)
4136 deriving (Eq, Ord, Generic, Show, Typeable, FromJSON)
4137
4137
@@ -4406,7 +4406,7 @@ data NodeIndicesStats = NodeIndicesStats {
4406 , nodeIndicesStatsDocsCount :: Int
4406 , nodeIndicesStatsDocsCount :: Int
4407 } deriving (Eq, Show, Generic, Typeable)
4407 } deriving (Eq, Show, Generic, Typeable)
4408
4408
4409−-- | A quirky address format used throughout ElasticSearch. An example
4409+-- | A quirky address format used throughout Elasticsearch. An example
4410-- would be inet[/1.1.1.1:9200]. inet may be a placeholder for a
4410-- would be inet[/1.1.1.1:9200]. inet may be a placeholder for a
4411-- <https://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN>.
4411-- <https://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN>.
4412newtype EsAddress = EsAddress { esAddress :: Text }
4412newtype EsAddress = EsAddress { esAddress :: Text }
@@ -4600,7 +4600,7 @@ defaultSnapshotRepoUpdateSettings = SnapshotRepoUpdateSettings True
4600
4600
4601
4601
4602-- | A filesystem-based snapshot repo that ships with
4602-- | A filesystem-based snapshot repo that ships with
4603−-- ElasticSearch. This is an instance of 'SnapshotRepo' so it can be
4603+-- Elasticsearch. This is an instance of 'SnapshotRepo' so it can be
4604-- used with 'updateSnapshotRepo'
4604-- used with 'updateSnapshotRepo'
4605data FsSnapshotRepo = FsSnapshotRepo {
4605data FsSnapshotRepo = FsSnapshotRepo {
4606 fsrName :: SnapshotRepoName
4606 fsrName :: SnapshotRepoName
@@ -4845,7 +4845,7 @@ newtype RestoreRenamePattern = RestoreRenamePattern { rrPattern :: Text }
4845
4845
4846-- | A single token in a index renaming scheme for a restore. These
4846-- | A single token in a index renaming scheme for a restore. These
4847-- are concatenated into a string before being sent to
4847-- are concatenated into a string before being sent to
4848−-- ElasticSearch. Check out these Java
4848+-- Elasticsearch. Check out these Java
4849-- <https://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html docs> to find out more if you're into that sort of thing.
4849-- <https://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html docs> to find out more if you're into that sort of thing.
4850data RestoreRenameToken = RRTLit Text
4850data RestoreRenameToken = RRTLit Text
4851 -- ^ Just a literal string of characters
4851 -- ^ Just a literal string of characters