# Elasticsearch(6.5) HIgh level java rest client Delete an index by name is not working

**URL:** https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939
**Category:** Elasticsearch
**Created:** [April 2, 2019, 8:28am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939 "2019-04-02T08:28:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 2, 2019, 8:28am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/1 "2019-04-02T08:28:56Z")

</div>

I can delete an document by passing the index name , type and id like this-

```auto
DeleteRequest deleteRequest = new DeleteRequest(data.getIndexName(),data.getType(),data.getUniqueId());

		DeleteResponse deleteResponse = client.delete(deleteRequest);
		

```

But when I am trying to delete an index by giving the index name only like below- (According to [this document](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high-delete-index.html))

```auto
DeleteRequest deleteRequest = new DeleteRequest(allData.getIndexName());

		DeleteResponse deleteResponse = client.delete(deleteRequest);
		

```

getting -

```auto
org.elasticsearch.action.ActionRequestValidationException: Validation Failed: 1: type is missing;2: id is missing;

```

I have tried another way like this ([reference](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-delete-index.html))

```auto
DeleteIndexRequest request = new DeleteIndexRequest(allData.getIndexName());
		AcknowledgedResponse deleteIndexResponse = client.indices().delete(request, RequestOptions.DEFAULT);

```

getting-

```auto
java.lang.NoSuchMethodError: 
	at org.elasticsearch.client.IndicesClient.delete(IndicesClient.java:93) ~[elasticsearch-rest-high-level-client-6.5.4.jar:6.4.3]

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 2, 2019, 9:47am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/2 "2019-04-02T09:47:23Z")

</div>

There's something strange in the last line you pasted. A mix of versions.  
Check that you have 6.5 at least and only one version in your classpath.

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 2, 2019, 10:06am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/3 "2019-04-02T10:06:03Z")

</div>

I am using below dependency -

```auto
       <dependency>
           <groupId>org.elasticsearch.client</groupId>
           <artifactId>elasticsearch-rest-high-level-client</artifactId>
           <version>6.5.4</version>
       </dependency>

```

And its showing an warning near version as - "Overriding managed version 6.4.3 for elasticsearch-rest-high-level-client" in the pom.xml

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 2, 2019, 12:18pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/4 "2019-04-02T12:18:18Z")

</div>

What gives

```
mvn dependency:tree
```

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 2, 2019, 12:19pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/5 "2019-04-02T12:19:45Z")

</div>

sorry didn't get you.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 2, 2019, 12:53pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/6 "2019-04-02T12:53:13Z")

</div>

Run the command I shared and share the output

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 2, 2019, 1:23pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/7 "2019-04-02T13:23:45Z")

</div>

I have attached the dependency hierarchy and the dependency which I have used in pom.xml. But I can't understand why its showing elasticsearch : 6.4.3 (/manged from 6.5.4) but I didn't used 6.4.3 anywhere.

![Screenshot%20from%202019-04-02%2018-40-17](https://us1.discourse-cdn.com/elastic/original/3X/9/0/900833a6ad195474f8b8c5db4874286f165fc79f.png)

 ![Screenshot%20from%202019-04-02%2018-39-46](https://us1.discourse-cdn.com/elastic/original/3X/d/0/d0ce6a865f08b36ecb09aefc066a50039b4bc56f.png)

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 2, 2019, 2:25pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/8 "2019-04-02T14:25:42Z")

</div>

That's not what I asked for.

Anyway, you can see that you need to fix your `pom.xml`. Most likely this is coming from spring boot you seem to be using.

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 2, 2019, 4:31pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/9 "2019-04-02T16:31:11Z")

</div>

Actually I didn't understand that properly ,I thought you are asking for the dependency hierarchy. so could you please tell me once again what you want? and how to run this command

```auto
mvn dependency:tree

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 2, 2019, 6:17pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/10 "2019-04-02T18:17:52Z")

</div>

Open a terminal.  
Type:

```
mvn dependency:tree
```

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 2, 2019, 6:52pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/11 "2019-04-02T18:52:16Z")

</div>

I have run that command in a terminal opened inside my project folder then at the end I get the message BUILD SUCCESS.what do you mean by output, those terminal things or anything else (if any files generated) ?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 2, 2019, 8:37pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/12 "2019-04-02T20:37:22Z")

</div>

All what is printed.

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 3, 2019, 5:30am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/13 "2019-04-03T05:30:19Z")

</div>

```auto
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.example:search-service:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.google.code.gson:gson:jar -> version 2.8.2 vs 2.6.2 @ line 40, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building search-service 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ search-service ---
[INFO] com.example:search-service:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.1.2.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.1.2.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.1.2.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.11.1:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.23:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.1.2.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.8:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.8:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.8:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.8:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.8:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.1.2.RELEASE:compile

```

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 3, 2019, 5:31am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/14 "2019-04-03T05:31:01Z")

</div>

```auto
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.14:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.14:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.14:compile
[INFO] | +- org.hibernate.validator:hibernate-validator:jar:6.0.14.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.4.0:compile
[INFO] | +- org.springframework:spring-web:jar:5.1.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:5.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.1.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-thymeleaf:jar:2.1.2.RELEASE:compile
[INFO] | +- org.thymeleaf:thymeleaf-spring5:jar:3.0.11.RELEASE:compile
[INFO] | | +- org.thymeleaf:thymeleaf:jar:3.0.11.RELEASE:compile
[INFO] | | | +- org.attoparser:attoparser:jar:2.0.5.RELEASE:compile
[INFO] | | | \- org.unbescape:unbescape:jar:1.1.6.RELEASE:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] | \- org.thymeleaf.extras:thymeleaf-extras-java8time:jar:3.0.2.RELEASE:compile
[INFO] +- org.json:json:jar:20180813:compile
[INFO] +- com.google.code.gson:gson:jar:2.6.2:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.1.2.RELEASE:runtime
[INFO] | +- org.springframework.boot:spring-boot:jar:2.1.2.RELEASE:compile
[INFO] | \- org.springframework.boot:spring-boot-autoconfigure:jar:2.1.2.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.1.2.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.1.2.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.1.2.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.3:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.assertj:assertj-core:jar:3.11.1:test
[INFO] | +- org.mockito:mockito-core:jar:2.23.4:test
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.9.7:test
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.9.7:test
[INFO] | | \- org.objenesis:objenesis:jar:2.6:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:5.1.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-test:jar:5.1.4.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.6.2:test
[INFO] \- org.elasticsearch.client:elasticsearch-rest-high-level-client:jar:6.5.4:compile
[INFO] +- org.elasticsearch:elasticsearch:jar:6.4.3:compile
[INFO] | +- org.elasticsearch:elasticsearch-core:jar:6.4.3:compile
[INFO] | +- org.elasticsearch:elasticsearch-secure-sm:jar:6.4.3:compile
[INFO] | +- org.elasticsearch:elasticsearch-x-content:jar:6.4.3:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.9.8:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.9.8:compile
[INFO] | | \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.9.8:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-analyzers-common:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-backward-codecs:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-grouping:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-highlighter:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-join:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-memory:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-misc:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-queries:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-queryparser:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-sandbox:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-spatial:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-spatial-extras:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-spatial3d:jar:7.4.0:compile
[INFO] | +- org.apache.lucene:lucene-suggest:jar:7.4.0:compile
[INFO] | +- org.elasticsearch:elasticsearch-cli:jar:6.4.3:compile
[INFO] | | \- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile
[INFO] | +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] | +- joda-time:joda-time:jar:2.10.1:compile
[INFO] | +- com.tdunning:t-digest:jar:3.2:compile
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.11.1:compile
[INFO] | \- org.elasticsearch:jna:jar:4.5.1:compile
[INFO] +- org.elasticsearch.client:elasticsearch-rest-client:jar:6.4.3:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.10:compile
[INFO] | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile
[INFO] | +- org.apache.httpcomponents:httpcore-nio:jar:4.4.10:compile
[INFO] | \- commons-codec:commons-codec:jar:1.11:compile
[INFO] +- org.elasticsearch.plugin:parent-join-client:jar:6.5.4:compile
[INFO] +- org.elasticsearch.plugin:aggs-matrix-stats-client:jar:6.5.4:compile
[INFO] +- org.elasticsearch.plugin:rank-eval-client:jar:6.5.4:compile
[INFO] \- org.elasticsearch.plugin:lang-mustache-client:jar:6.5.4:compile
[INFO] \- com.github.spullara.mustache.java:compiler:jar:0.9.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.861 s
[INFO] Finished at: 2019-04-03T10:53:40+05:30
[INFO] Final Memory: 29M/220M
[INFO] ------------------------------------------------------------------------

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 3, 2019, 5:44am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/15 "2019-04-03T05:44:09Z")

</div>

What is you full `pom.xml`?

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 3, 2019, 5:50am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/16 "2019-04-03T05:50:56Z")

</div>

```auto
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.1.2.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>com.example</groupId>
	<artifactId>search-service</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>search-service</name>
	<description>Demo project for search-service</description>

	<properties>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-thymeleaf</artifactId>
		</dependency>
		<dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20180813</version><!--$NO-MVN-MAN-VER$-->
        </dependency> 
		<dependency>
           <groupId>com.google.code.gson</groupId>
           <artifactId>gson</artifactId>
           <version>2.8.2</version><!--$NO-MVN-MAN-VER$-->
        </dependency>
        <dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
			<version>2.6.2</version><!--$NO-MVN-MAN-VER$ -->
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
           <groupId>org.elasticsearch.client</groupId>
           <artifactId>elasticsearch-rest-high-level-client</artifactId>
           <version>6.5.4</version>
       </dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>

```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 4, 2019, 1:14pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/17 "2019-04-04T13:14:24Z")

</div>

This is happening because of:

```auto
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

```

When you remove it, you get:

```auto
[INFO] com.example:search-service:jar:0.0.1-SNAPSHOT
[INFO] \- org.elasticsearch.client:elasticsearch-rest-high-level-client:jar:6.5.4:compile
[INFO] +- org.elasticsearch:elasticsearch:jar:6.5.4:compile

```

So I think you need to explicitly import the `elasticsearch:jar:6.5.4`.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 4, 2019, 3:45pm UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/18 "2019-04-04T15:45:57Z")

</div>

I reproduced it from my own projects. It's annoying that spring boot now (from 2.1) sets in the stone the elasticsearch version to use IMO.

For example, here is what I did for version 7.0:

> <https://github.com/dadoonet/legacy-search/commit/55a5ad849ae23c5811864611e689731a258220b2>

---

<div class="post-metadata">

### Author: ![Aswini\_Kumar\_Rout](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aswini_kumar_rout/32/42165_2.png) [@Aswini\_Kumar\_Rout](https://discuss.elastic.co/u/Aswini_Kumar_Rout)
#### Post date: [April 5, 2019, 6:19am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/19 "2019-04-05T06:19:23Z")

</div>

> [@dadoonet](#):
>
> For example,

Thank you for your reply. For now I have used java low level rest client to achieve the requirements. OR else

To force load elasticsearch 6.5.4 I have added the following property to my pom which will override the property defined in spring-boot-dependencies pom

```auto
<properties>
    <elasticsearch.version>6.5.4</elasticsearch.version>
</properties>
<dependencies>
    ...
    <dependency>
        <groupId>org.elasticsearch.client</groupId>
        <artifactId>elasticsearch-rest-high-level-client</artifactId>
        <version>${elasticsearch.version}</version>
    </dependency>
    ...
</dependencies>

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 3, 2019, 6:19am UTC](https://discuss.elastic.co/t/elasticsearch-6-5-high-level-java-rest-client-delete-an-index-by-name-is-not-working/174939/20 "2019-05-03T06:19:24Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
