# No mapping Found On \[field\] Sorting Issue

**URL:** https://discuss.elastic.co/t/no-mapping-found-on-field-sorting-issue/230433
**Category:** Elasticsearch
**Created:** [April 29, 2020, 8:13pm UTC](https://discuss.elastic.co/t/no-mapping-found-on-field-sorting-issue/230433 "2020-04-29T20:13:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Severin\_Simko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/severin_simko/32/45707_2.png) [@Severin\_Simko](https://discuss.elastic.co/u/Severin_Simko)
#### Post date: [April 29, 2020, 8:13pm UTC](https://discuss.elastic.co/t/no-mapping-found-on-field-sorting-issue/230433/1 "2020-04-29T20:13:55Z")

</div>

Hi,

I'm currently experiencing a problem when I'm trying to search based on some specific field, I'm seeing this error log:

Caused by: org.elasticsearch.index.query.QueryShardException: No mapping found for [process\_id] in order to sort on.

I added a new custom mapping and rotated the indexes,

When I try curl -X GET '[http://localhost:9200/graylog\_15/\_search?pretty=true&sort='process\_id'](http://localhost:9200/graylog_15/_search?pretty=true&sort='process_id')' (graylog\_15 index was created after the rotation and contains the custom mapping for this process\_id field) the problem is when I try to sort based on the same field in some old index.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/f/bf7ec19f8a9fb1c6cb26bf4197afcfeaf8ba5237.png)

Based on that I'm assuming that the custom mapping rules are only added to newly created indexes, so my question is: **is it possible to update mapping rules for all old indexes so I can sort on logs that are included in old indexes?**

My custom mapping.json looks like this:

```auto
{
"template": "graylog_9",
"mappings" : {
  "message" : {
    "properties" : {
      "winlogbeat_agent_type " : {
        "type" : "keyword"
      },
      "process_id" : {
      "type": "long"}
    }
  }
}
}

```

---

<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: [May 27, 2020, 8:13pm UTC](https://discuss.elastic.co/t/no-mapping-found-on-field-sorting-issue/230433/2 "2020-05-27T20:13:56Z")

</div>

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