You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Remove samples for TcpClient
There's probably no sense showing and maintaining examples for
deprecated code.
* Update samples for 6.3.3
* Update some README documentation for current release/master
// Response also supports familiar combinators like map / flatMap / foreach:
182
+
resp foreach (search => println(s"There were ${search.totalHits} total hits"))
183
+
176
184
client.close()
177
185
}
178
186
```
@@ -334,12 +342,12 @@ resolvers += "elasticsearch-releases" at "https://artifacts.elastic.co/maven"
334
342
335
343
## Embedded Node
336
344
337
-
A locally configured node and client can be created by including the elastic4s-embedded module. Then a local node can be started by invoking `LocalNode()` with the cluster name and data path. From the local node we can return a handle to the client by invoking the `elastic4sclient` function.
345
+
A locally configured node and client can be created by including the elastic4s-embedded module. Then a local node can be started by invoking `LocalNode()` with the cluster name and data path. From the local node we can return a handle to the client by invoking the `client` function.
338
346
339
347
```scala
340
-
importcom.sksamuel.elastic4s.ElasticClient
348
+
importcom.sksamuel.elastic4s.embedded.LocalNode
341
349
valnode=LocalNode(clusterName, pathHome)
342
-
valclient= node.elastic4sclient()
350
+
valclient= node.client(shutdownNodeOnClose =true)
343
351
```
344
352
345
353
To specify settings for the local node you can pass in a settings object like this:
@@ -350,7 +358,7 @@ val settings = Settings.builder()
If `shutdownNodeOnClose` is true, then once close is called on the client, the local node will be stopped. Otherwise you will manage the lifecycle of the local node yourself (stopping it before exiting the process).
Copy file name to clipboardExpand all lines: samples/elastic4s-http-client-gradle/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala
Copy file name to clipboardExpand all lines: samples/elastic4s-http-client-maven/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala
Copy file name to clipboardExpand all lines: samples/elastic4s-http-client-sbt/src/main/scala/com/sksamuel/elastic4s/samples/HttpClientExampleApp.scala
Copy file name to clipboardExpand all lines: samples/elastic4s-tcp-client-gradle/src/main/scala/com/sksamuel/elastic4s/samples/TcpClientExampleApp.scala
0 commit comments