# How to get search request details from the CountResponse

**URL:** https://discuss.elastic.co/t/how-to-get-search-request-details-from-the-countresponse/40312
**Category:** Elasticsearch
**Created:** [January 28, 2016, 1:43am UTC](https://discuss.elastic.co/t/how-to-get-search-request-details-from-the-countresponse/40312 "2016-01-28T01:43:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Harish\_Ramanathan](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Harish\_Ramanathan](https://discuss.elastic.co/u/Harish_Ramanathan)
#### Post date: [January 28, 2016, 1:43am UTC](https://discuss.elastic.co/t/how-to-get-search-request-details-from-the-countresponse/40312/1 "2016-01-28T01:43:43Z")

</div>

I am using the code as below to get count for a particular search term. I would like to know from the response as to what is the index that the search was run on. I am not seeing anything expect the count in the response. Any help is appreciated.  
QueryBuilder searchQueryBuilder = ....  
CountResponse response = client.prepareCount("index-name")  
.setQuery(searchQueryBuilder)  
.execute()  
.actionGet();

---

<div class="post-metadata">

### Author: ![Harish\_Ramanathan](https://avatars.discourse-cdn.com/v4/letter/h/e19b73/32.png) [@Harish\_Ramanathan](https://discuss.elastic.co/u/Harish_Ramanathan)
#### Post date: [January 30, 2016, 10:53pm UTC](https://discuss.elastic.co/t/how-to-get-search-request-details-from-the-countresponse/40312/2 "2016-01-30T22:53:58Z")

</div>

CountResponse is deprecated in 2.1.1. Need to use SearchResponse.

---

<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: [July 5, 2017, 11:20pm UTC](https://discuss.elastic.co/t/how-to-get-search-request-details-from-the-countresponse/40312/3 "2017-07-05T23:20:08Z")

</div>


