# CountAsync can't consume descriptor like SearchAsync

**URL:** <https://discuss.elastic.co/t/countasync-cant-consume-descriptor-like-searchasync/286794>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [October 15, 2021, 5:14am UTC](https://discuss.elastic.co/t/countasync-cant-consume-descriptor-like-searchasync/286794 "2021-10-15T05:14:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![puksigon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/puksigon/32/96303_2.png) [@puksigon](https://discuss.elastic.co/u/puksigon)\
**Post date:** [October 15, 2021, 5:14am UTC](https://discuss.elastic.co/t/countasync-cant-consume-descriptor-like-searchasync/286794/1 "2021-10-15T05:14:02Z")

</div>

![2021-10-15_12-07-34](https://us1.discourse-cdn.com/elastic/original/3X/1/b/1b4427b61dd2ccf76ef777e778b16c3b4cbd00e2.jpeg)

I use Nest lib in my project. I try to use repository pattern with base repository class.  
For search method, is work fine with "SearchDescriptor", but for count method, is't work with "CountDescriptor" like search method.

How should I do with this or there are another way to do like this.  
Thanks

---

<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:** [November 12, 2021, 5:15am UTC](https://discuss.elastic.co/t/countasync-cant-consume-descriptor-like-searchasync/286794/2 "2021-11-12T05:15:02Z")

</div>

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