# RestHighLevelClient, warning "Deprecated field \[type\] used"

**URL:** <https://discuss.elastic.co/t/resthighlevelclient-warning-deprecated-field-type-used/351870>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [January 26, 2024, 10:11am UTC](https://discuss.elastic.co/t/resthighlevelclient-warning-deprecated-field-type-used/351870 "2024-01-26T10:11:46Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![swallez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swallez/32/11972_2.png) [@swallez](https://discuss.elastic.co/u/swallez)\
**Post date:** [January 29, 2024, 10:22am UTC](https://discuss.elastic.co/t/resthighlevelclient-warning-deprecated-field-type-used/351870/4 "2024-01-29T10:22:44Z")

</div>

Thanks for the additional details. By default the `RestHighLevelClient` will send `type = "MEMORY"` and the server will issue a warning. And unfortunately setting `type` to `null` will throw an exception.

There are two options:

- use the Java API client for this request. You don't have to migrate your entire application: Java API client and HLRC can [smoothly work side by side with the same low level client](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/7.17/migrate-hlrc.html).
- disable [deprecation warnings on the server](https://discuss.elastic.co/t/turn-off-es-deprecation-logs-dynamically/221948). But this will hide all deprecation warnings, which may be valuable information.

---

_[View the full topic](https://discuss.elastic.co/t/resthighlevelclient-warning-deprecated-field-type-used/351870)._
