# Java High Level REST Client : How to remove \_type,\_id,\_index from hits\[\]

**URL:** https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727
**Category:** Elasticsearch
**Created:** [December 6, 2018, 12:33pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727 "2018-12-06T12:33:00Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![smidev11](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@smidev11](https://discuss.elastic.co/u/smidev11)
#### Post date: [December 6, 2018, 12:33pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727/1 "2018-12-06T12:33:00Z")

</div>

Hi,

I am using Java High Level REST Client to get the data. I used the Search api to get the response.  
My response has hits arrays. and each hit contains the \_type,\_id,\_index,\_score fields.Actually I don't want these field to appear in my response.

Please let me know how to achieve this using High Level REST Client api.

My response look like as

"hits": [  
{  
**"\_index": "stratosevents",**  
**"\_type": "doc",**  
**"\_id":**"45e8af72-bf3f-4ebc-8197-bfcc4ba90f57-cisco",  
" **\_score":** 1.0909792,  
"\_source": {  
"field": true,

```
            }
        },
        {
            **"_index":**"stratosevents",
            **"_type":**"doc",
            **"_id":**"b75bfd4f-896b-40d7-af9f-ed92a96a904a-smm-sj12-ij1",
            **"_score":** 1.0909792,
            "_source": {
                "field": true,
            }
        },

```

Here I don't want to get this \_index, \_type,\_id and \_score fields in response.

Please suggest .

---

<div class="post-metadata">

### Author: ![smidev11](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@smidev11](https://discuss.elastic.co/u/smidev11)
#### Post date: [December 6, 2018, 12:36pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727/2 "2018-12-06T12:36:39Z")

</div>

Also let me know if this can be done via Low level rest client.

---

<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: [December 6, 2018, 1:24pm UTC](https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727/3 "2018-12-06T13:24:19Z")

</div>

Do you mean that you are sending back the json response as is to your users or to the frontend?

---

<div class="post-metadata">

### Author: ![smidev11](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@smidev11](https://discuss.elastic.co/u/smidev11)
#### Post date: [December 7, 2018, 4:29am UTC](https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727/4 "2018-12-07T04:29:36Z")

</div>

Yes. We want to send it to frontend.

Please suggest.

---

<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: [December 7, 2018, 9:14am UTC](https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727/5 "2018-12-07T09:14:46Z")

</div>

You can not do that.

---

<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: [January 4, 2019, 9:14am UTC](https://discuss.elastic.co/t/java-high-level-rest-client-how-to-remove-type-id-index-from-hits/159727/6 "2019-01-04T09:14:47Z")

</div>

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