0

For some bizarre reason, the following import is not being found by maven. I am not sure if it's removed from the dependency I get from maven or not. Could I please get a look at why it's not being found

import org.elasticsearch.client.RequestOptions;

I am using elastic version 6.3.2 with the high-level JAVA REST client as 6.3.2 also. My POM looks like this below.

         <dependency>
                    <groupId>org.elasticsearch.client</groupId>
                    <artifactId>elasticsearch-rest-high-level-client</artifactId>
                    <version>6.3.2</version>
                </dependency>

        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>6.3.2</version>
        </dependency>
Val
  • 207,596
  • 13
  • 358
  • 360
Mohamed Ali
  • 702
  • 8
  • 29

1 Answers1

2

RequestOptions was introduced in version 6.4 of the Rest High-Level client.

So you need to upgrade your client to 6.4.0 at least. That version might work with ES 6.3.2 but there might be some incompatibility issues as only forward compatibility is guaranteed.

The High Level Client is guaranteed to be able to communicate with any Elasticsearch node running on the same major version and greater or equal minor version.

Val
  • 207,596
  • 13
  • 358
  • 360
  • Are there any work arounds for this Val. I am using 6.3.2 at the moment and the only import failing is RequestOptions? – Mohamed Ali May 29 '20 at 03:37
  • 1
    Don't use RequestOptions since it's not available in your dependency :-) – Val May 29 '20 at 03:37
  • I just tried it and it worked Val. Thank you. I have another question but I will open up another one. Thank you a bunch! I have marked your answer also! – Mohamed Ali May 29 '20 at 03:45
  • Hey Val can you also assist with this question https://stackoverflow.com/questions/62092012/correct-the-classpath-for-compatible-versions-with-elasticsearch – Mohamed Ali May 29 '20 at 18:19
  • Can you assist with this question also Val https://stackoverflow.com/questions/62122439/elasticsearch-method-not-being-found-in-spring-boot – Mohamed Ali May 31 '20 at 21:26