# No mapping found for {field} in order to sort on for top hit metrics

**URL:** <https://discuss.elastic.co/t/no-mapping-found-for-field-in-order-to-sort-on-for-top-hit-metrics/161581>\
**Category:** Kibana\
**Created:** [December 19, 2018, 6:55pm UTC](https://discuss.elastic.co/t/no-mapping-found-for-field-in-order-to-sort-on-for-top-hit-metrics/161581 "2018-12-19T18:55:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasmine.liang](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@jasmine.liang](https://discuss.elastic.co/u/jasmine.liang)\
**Post date:** [December 19, 2018, 6:55pm UTC](https://discuss.elastic.co/t/no-mapping-found-for-field-in-order-to-sort-on-for-top-hit-metrics/161581/1 "2018-12-19T18:55:40Z")

</div>

Hi,

I am trying to create a visualization using top hit metric. But I always got warning/error say 2/30 shards failed. And when looking at the response, there are failures with reason 'No mapping found for {field} in order to sort on'.  
I did choose top hit as a sub metric and select a time as the field of sort on.  
Can I know what is the reason and how can I fix this?

Thanks!

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [December 20, 2018, 6:47pm UTC](https://discuss.elastic.co/t/no-mapping-found-for-field-in-order-to-sort-on-for-top-hit-metrics/161581/2 "2018-12-20T18:47:54Z")

</div>

Sometimes this happens when some of the documents in the index pattern don't have the field that you're sorting or searching on. Can you verify that all documents that are in your time range have the field it's sorting on?

---

<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 17, 2019, 7:01pm UTC](https://discuss.elastic.co/t/no-mapping-found-for-field-in-order-to-sort-on-for-top-hit-metrics/161581/3 "2019-01-17T19:01:49Z")

</div>

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