|
| 1 | +[[installation]] |
| 2 | +== Installation |
| 3 | + |
| 4 | +This page guides you through the installation process of the client. |
| 5 | + |
| 6 | +Requirements: |
| 7 | + |
| 8 | +* Java 8 or later. The library provides high-level type-safe classes |
| 9 | + and methods for all {es} APIs. It sits on top of the |
| 10 | + https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.htm8l[Low Level Rest Client] |
| 11 | + that manages all http communications. |
| 12 | + |
| 13 | +* The JSON implementation used by the Java client is pluggable and you must add |
| 14 | + a JSON object mapping library as a dependency to your project. It has support |
| 15 | + for https://github.com/FasterXML/jackson[Jackson] or a |
| 16 | + http://json-b.net/[JSON-B] library like |
| 17 | + https://github.com/eclipse-ee4j/yasson[Eclipse Yasson]. |
| 18 | + |
| 19 | + |
| 20 | +The GA releases are hosted on Maven Central. Snapshot versions are hosted on |
| 21 | +https://snapshots.elastic.co/maven/[Elastic's Maven snapshot repository]. |
| 22 | + |
| 23 | + |
| 24 | +[discrete] |
| 25 | +[[gradle]] |
| 26 | +=== Installation in a Gradle project by using Jackson |
| 27 | + |
| 28 | +``` |
| 29 | +repositories { |
| 30 | + mavenCentral() |
| 31 | + maven { |
| 32 | + name = "Elastic-Snapshots" |
| 33 | + url = uri("https://snapshots.elastic.co/maven") |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +dependencies { |
| 38 | + implementation 'co.elastic.clients:elasticsearch-java:7.15.0-SNAPSHOT' |
| 39 | + implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3' |
| 40 | +} |
| 41 | +``` |
| 42 | + |
| 43 | +[discrete] |
| 44 | +[[maven]] |
| 45 | +=== Installation in a Maven project by using Jackson |
| 46 | + |
| 47 | +In the `pom.xml` of your project, add the following repository definition and |
| 48 | +dependencies: |
| 49 | + |
| 50 | +``` |
| 51 | +<project> |
| 52 | + |
| 53 | + <repositories> |
| 54 | + <repository> |
| 55 | + <id>Elastic-Snapshots</id> |
| 56 | + <url>https://snapshots.elastic.co/maven</url> |
| 57 | + <snapshots> |
| 58 | + <enabled>true</enabled> |
| 59 | + </snapshots> |
| 60 | + </repository> |
| 61 | + </repositories> |
| 62 | + |
| 63 | + <dependencies> |
| 64 | + <dependency> |
| 65 | + <groupId>co.elastic.clients</groupId> |
| 66 | + <artifactId>elasticsearch-java</artifactId> |
| 67 | + <version>7.15.0-SNAPSHOT</version> |
| 68 | + </dependency> |
| 69 | + <dependency> |
| 70 | + <groupId>com.fasterxml.jackson.core</groupId> |
| 71 | + <artifactId>jackson-databind</artifactId> |
| 72 | + <version>2.12.3</version> |
| 73 | + </dependency> |
| 74 | + </dependencies> |
| 75 | + |
| 76 | +</project> |
| 77 | +``` |
| 78 | + |
| 79 | +[discrete] |
| 80 | +[[compatibility]] |
| 81 | +=== Compatibility |
| 82 | + |
| 83 | +The `main` branch targets the next major release (8.0), the `7.x` branch targets |
| 84 | +the next minor release. Support is still incomplete as the API code is generated |
| 85 | +from the {es} Specification that is also still a work in progress. |
| 86 | + |
| 87 | +The {es} Java client is forward compatible; meaning that the client supports |
| 88 | +communicating with greater or equal minor versions of {es}. {es} language |
| 89 | +clients are only backwards compatible with default distributions and without |
| 90 | +guarantees made. |
0 commit comments