# Change mapping for Metricbeat percentages from long to double

**URL:** <https://discuss.elastic.co/t/change-mapping-for-metricbeat-percentages-from-long-to-double/122896>\
**Category:** Elasticsearch\
**Created:** [March 7, 2018, 2:15pm UTC](https://discuss.elastic.co/t/change-mapping-for-metricbeat-percentages-from-long-to-double/122896 "2018-03-07T14:15:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ujjain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ujjain/32/27378_2.png) [@ujjain](https://discuss.elastic.co/u/ujjain)\
**Post date:** [March 7, 2018, 2:15pm UTC](https://discuss.elastic.co/t/change-mapping-for-metricbeat-percentages-from-long-to-double/122896/1 "2018-03-07T14:15:56Z")

</div>

I have an issue where percentages don't allow for sorting on some percentages, because they're long and no doubles. The percentages are as 0.23, 0.87.

```
curl -XGET "http://127.0.0.1:9200/metricbeat-2018.03.07/_mapping/doc

"system" : {
  "properties" : {
    "core" : {
      "properties" : {
        "id" : {
          "type" : "long"
        },
        "idle" : {
          "properties" : {
            "pct" : {
              "type" : "double"
            }
          }
        },
        "iowait" : {
          "properties" : {
            "pct" : {
              "type" : "long"
            }
          }
        },

```

_Percentages that are doubles sort fine, but percentages that are longs don't sort._

I'd like to change the mappings on the new metricbeat-indices for percentages from long to double. How could I do this?

The metricbeat-template is almost empty, so I am not sure what populates the mappings of metricbeat.

We're using Metricbeat 6.2.2 and ElasticSearch 2.4

---

<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:** [April 4, 2018, 2:16pm UTC](https://discuss.elastic.co/t/change-mapping-for-metricbeat-percentages-from-long-to-double/122896/2 "2018-04-04T14:16:02Z")

</div>

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