# Is there a reason you cannot use \[runtime\_mappings\] in a \_count request?

**URL:** <https://discuss.elastic.co/t/is-there-a-reason-you-cannot-use-runtime-mappings-in-a-count-request/291334>\
**Category:** Elasticsearch\
**Tags:** runtime-fields\
**Created:** [December 9, 2021, 1:54pm UTC](https://discuss.elastic.co/t/is-there-a-reason-you-cannot-use-runtime-mappings-in-a-count-request/291334 "2021-12-09T13:54:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sz\_bb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sz_bb/32/80579_2.png) [@sz\_bb](https://discuss.elastic.co/u/sz_bb)\
**Post date:** [December 9, 2021, 1:54pm UTC](https://discuss.elastic.co/t/is-there-a-reason-you-cannot-use-runtime-mappings-in-a-count-request/291334/1 "2021-12-09T13:54:55Z")

</div>

I'd like to take advantage of [runtime\_mappings] in a search request, specifically leveraging that runtime\_field as a filter. In that scenario, while I may only have a size of 50 to return the top 50 docs, I also request the count using the same query to get the entire count of records that matched. Unfortunately, I cannot specify [runtime\_mappings] in a count request as that returns a 400 parsing exception.

I cannot use index mapping of the runtime field because I need to feed in params (such as the user's timezone offset) in order to calculate dates accurately. I cannot find a way to pass params in a search request to a runtime field defined via an index mapping.

---

<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 6, 2022, 1:55pm UTC](https://discuss.elastic.co/t/is-there-a-reason-you-cannot-use-runtime-mappings-in-a-count-request/291334/2 "2022-01-06T13:55:24Z")

</div>

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