https://github.com/aparo/elasticsearch-7.x-cookbook
Code for the Book - ElasticSearch 7.x Cookbook
https://github.com/aparo/elasticsearch-7.x-cookbook
Last synced: over 1 year ago
JSON representation
Code for the Book - ElasticSearch 7.x Cookbook
- Host: GitHub
- URL: https://github.com/aparo/elasticsearch-7.x-cookbook
- Owner: aparo
- License: apache-2.0
- Created: 2018-10-27T08:37:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-11-16T11:45:05.000Z (over 3 years ago)
- Last Synced: 2025-03-26T23:35:25.316Z (over 1 year ago)
- Language: Shell
- Size: 8.56 MB
- Stars: 17
- Watchers: 3
- Forks: 11
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elasticsearch-7.x-cookbook
Code for the Book - ElasticSearch 7.x Cookbook
## Changelog
2019/09/14
Upgrade docker to 7.3.1
Upgrade Elastic4s to 7.3.1 version.
## Refactory of Elastic4s 7.x
Elastic4s was not released for 7.x during book writing. During 7.x Elastic4s had a code refactory. Main changes are:
### Moving imports
Imports are changed and moved from
```
import com.sksamuel.elastic4s.http.ElasticDsl._
```
to
```
import com.sksamuel.elastic4s.ElasticDsl._
```
### Different clients
To use the Elasticsearch Client you need to use the following entry in build.sbt
```
"com.sksamuel.elastic4s" %% "elastic4s-client-esjava" % elastic4sV
```
There are different cleints. You must provide one during initialization.
The initialization should change from:
```
lazy val client = ElasticClient(
ElasticProperties(s"http://localhost:9200")
)
```
to
```
import com.sksamuel.elastic4s.http._
lazy val client = ElasticClient(
JavaClient(ElasticProperties(s"http://localhost:9200"))
)
```