- Java REST Client (deprecated): other versions:
- Overview
- Java Low Level REST Client
- Java High Level REST Client
- Getting started
- Document APIs
- Search APIs
- Miscellaneous APIs
- Indices APIs
- Analyze API
- Create Index API
- Delete Index API
- Indices Exists API
- Open Index API
- Close Index API
- Shrink Index API
- Split Index API
- Refresh API
- Flush API
- Flush Synced API
- Clear Cache API
- Force Merge API
- Rollover Index API
- Put Mapping API
- Get Mappings API
- Get Field Mappings API
- Index Aliases API
- Exists Alias API
- Get Alias API
- Update Indices Settings API
- Get Settings API
- Put Template API
- Validate Query API
- Get Templates API
- Get Index API
- Cluster APIs
- Ingest APIs
- Snapshot APIs
- Tasks APIs
- Script APIs
- Watcher APIs
- Using Java Builders
- Migration Guide
- License
Maven Repository
editMaven Repository
editThe high-level Java REST client is hosted on
Maven
Central. The minimum Java version required is 1.8
.
The High Level REST Client is subject to the same release cycle as Elasticsearch. Replace the version with the desired client version.
If you are looking for a SNAPSHOT version, the Elastic Maven Snapshot repository is available at https://snapshots.elastic.co/maven/.
Maven configuration
editHere is how you can configure the dependency using maven as a dependency manager.
Add the following to your pom.xml
file:
<dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>6.4.3</version> </dependency>
Gradle configuration
editHere is how you can configure the dependency using gradle as a dependency manager.
Add the following to your build.gradle
file:
dependencies { compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client:6.4.3' }
Lucene Snapshot repository
editThe very first releases of any major version (like a beta), might have been built on top of a Lucene Snapshot version. In such a case you will be unable to resolve the Lucene dependencies of the client.
For example, if you want to use the 6.0.0-beta1
version which depends on Lucene 7.0.0-snapshot-00142c9
, you must
define the following repository.
For Maven:
<repository> <id>elastic-lucene-snapshots</id> <name>Elastic Lucene Snapshots</name> <url>http://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/00142c9</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>false</enabled></snapshots> </repository>
For Gradle:
maven { url 'http://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/00142c9' }