Error when close REST response

Hi, I am using Elastic sesarch 7.6.0 with REST Client API in spring-boot.

This is problem code.

CloseIndexResponse closeIndexResponse = 
                    client.indices().close(requestClose, RequestOptions.DEFAULT);

In this part, .close() occurs error.

Error message :

The method close(org.elasticsearch.client.indices.CloseIndexRequest, 
org.elasticsearch.client.RequestOptions) in the type IndicesClient is not applicable for the 
arguments (org.elasticsearch.action.admin.indices.close.CloseIndexRequest, 

I referenced this.

AcknowledgedResponse closeIndexResponse = client.indices().close(request, 


Is there any problem?


I think you might have different versions on the classpath.

When using springboot with
elasticsearch, you need to be explicit with some transitive dependencies as SpringBoot declares a version 6.4...

Basically you can put this in your pom.xml:


See documentation here:

Thank you for answer.

I stated elasticsearch version in pom.xml like this :


            <!-- <version>6.4.3</version> --> => Leave it on during version change

Do I have to use <property> tag instead of <version> tag?

I believe so.

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