# Increase elasticsearch version when importing resthighlevelclient

**URL:** <https://discuss.elastic.co/t/increase-elasticsearch-version-when-importing-resthighlevelclient/266735>\
**Category:** Elasticsearch\
**Created:** [March 9, 2021, 6:16pm UTC](https://discuss.elastic.co/t/increase-elasticsearch-version-when-importing-resthighlevelclient/266735 "2021-03-09T18:16:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carlos\_Fernando\_Palm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_fernando_palm/32/77804_2.png) [@Carlos\_Fernando\_Palm](https://discuss.elastic.co/u/Carlos_Fernando_Palm)\
**Post date:** [March 9, 2021, 6:16pm UTC](https://discuss.elastic.co/t/increase-elasticsearch-version-when-importing-resthighlevelclient/266735/1 "2021-03-09T18:16:18Z")

</div>

Hello people. I am using resthighlevelclient to connect to elasticsearch 7.9.3. Now I have done by importing all of this:

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

        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
            <version>7.9.3</version>
        </dependency>

        <dependency>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
            <version>7.9.3</version>
        </dependency>

```

All according to this question here:

> <https://stackoverflow.com/questions/62338588/spring-boot-with-elastic-search-causing-java-lang-nosuchfielderror-ignore-depre>

Now I would like to to know if there is a way to import just the rest high level client. When doing so I end up seeing this in my dependency tree:

```auto
[INFO] \- org.elasticsearch.client:elasticsearch-rest-high-level-client:jar:7.9.3: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-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] | +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] | +- com.tdunning:t-digest:jar:3.2:compile
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.11.2: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.8:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.11:compile
[INFO] | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile
[INFO] | +- org.apache.httpcomponents:httpcore-nio:jar:4.4.11:compile
[INFO] | \- commons-codec:commons-codec:jar:1.11:compile
[INFO] +- org.elasticsearch.plugin:mapper-extras-client:jar:7.9.3:compile
[INFO] +- org.elasticsearch.plugin:parent-join-client:jar:7.9.3:compile
[INFO] +- org.elasticsearch.plugin:aggs-matrix-stats-client:jar:7.9.3:compile
[INFO] +- org.elasticsearch.plugin:rank-eval-client:jar:7.9.3:compile
[INFO] \- org.elasticsearch.plugin:lang-mustache-client:jar:7.9.3:compile
[INFO] \- com.github.spullara.mustache.java:compiler:jar:0.9.6:compile

```

It looks like the client always imports elasticsearch 6.4.3. This is a problem for me (see the above stack overflow question).

Anyway, thanks for any help. Cheers!

---

<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:** [March 9, 2021, 7:01pm UTC](https://discuss.elastic.co/t/increase-elasticsearch-version-when-importing-resthighlevelclient/266735/2 "2021-03-09T19:01:41Z")

</div>

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with `</>` icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

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`:

```auto
<properties>
  <elasticsearch.version>7.11.1<elasticsearch.version>
</properties>

```

See documentation here: [“How-to” Guides](https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto-customize-dependency-versions)

---

<div class="post-metadata">

**Author:** ![Carlos\_Fernando\_Palm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_fernando_palm/32/77804_2.png) [@Carlos\_Fernando\_Palm](https://discuss.elastic.co/u/Carlos_Fernando_Palm)\
**Post date:** [March 9, 2021, 8:14pm UTC](https://discuss.elastic.co/t/increase-elasticsearch-version-when-importing-resthighlevelclient/266735/3 "2021-03-09T20:14:32Z")

</div>

Edited to paste code instead of an image. Thanks! works perfectly.

---

<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:** [April 6, 2021, 8:15pm UTC](https://discuss.elastic.co/t/increase-elasticsearch-version-when-importing-resthighlevelclient/266735/4 "2021-04-06T20:15:09Z")

</div>

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