# Total hits with requestTransformer and collapse

**URL:** <https://discourse.hibernate.org/t/total-hits-with-requesttransformer-and-collapse/5141>\
**Category:** Hibernate Search\
**Created:** [March 5, 2021, 5:46pm UTC](https://discourse.hibernate.org/t/total-hits-with-requesttransformer-and-collapse/5141 "2021-03-05T17:46:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xpete](https://avatars.discourse-cdn.com/v4/letter/x/bbce88/32.png) [@xpete](https://discourse.hibernate.org/u/xpete)\
**Post date:** [March 5, 2021, 5:46pm UTC](https://discourse.hibernate.org/t/total-hits-with-requesttransformer-and-collapse/5141/1 "2021-03-05T17:46:23Z")

</div>

Hi,

I’am using the field collapse feature of elastic search through the requestTransformer but when but I call the total().hitCount() it returns the total without the collapse.

How can I get the correct value?  
Thanks

---

<div class="post-metadata">

**Author:** ![yrodiere](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yrodiere/32/1760_2.png) [@yrodiere](https://discourse.hibernate.org/u/yrodiere)\
**Post date:** [March 8, 2021, 7:31am UTC](https://discourse.hibernate.org/t/total-hits-with-requesttransformer-and-collapse/5141/2 "2021-03-08T07:31:21Z")

</div>

From [Elasticsearch’s documentation](https://www.elastic.co/guide/en/elasticsearch/reference/7.11/collapse-search-results.html):

> The total number of hits in the response indicates the number of matching documents without collapsing. The total number of distinct group is unknown.

So I don’t think you can get the correct value.
