# Java High Level Rest Client - typed\_keys parameter

**URL:** <https://discuss.elastic.co/t/java-high-level-rest-client-typed-keys-parameter/144544>\
**Category:** Elasticsearch\
**Created:** [August 15, 2018, 3:57pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-typed-keys-parameter/144544 "2018-08-15T15:57:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oktaz](https://avatars.discourse-cdn.com/v4/letter/o/df705f/32.png) [@Oktaz](https://discuss.elastic.co/u/Oktaz)\
**Post date:** [August 15, 2018, 3:57pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-typed-keys-parameter/144544/1 "2018-08-15T15:57:23Z")

</div>

Using the High Level REST Client, I'm unable to find a way of setting the "typed\_keys" parameter on a search post.

I am using the SearchRequest object and RestHighLevelClient.

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [August 17, 2018, 9:19am UTC](https://discuss.elastic.co/t/java-high-level-rest-client-typed-keys-parameter/144544/2 "2018-08-17T09:19:11Z")

</div>

There have been previous discussions on this. The high-level REST client needs typed\_keys set to true, otherwise it cannot parse responses properly. This should be transparent unless you print out a given search response in json format using the toXContent method. In that case you do see the weird prefixes within aggregations and suggestions names. If you do so, I would ask why you need to do that: the high-level REST client is all about not having to deal with json. If you need the json, use the low-level REST client which does no parsing hence does not need the typed\_keys parameter.

---

<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:** [September 14, 2018, 9:19am UTC](https://discuss.elastic.co/t/java-high-level-rest-client-typed-keys-parameter/144544/3 "2018-09-14T09:19:21Z")

</div>

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