# No mapping found for \[filedname\] in order to sort on

**URL:** <https://discuss.elastic.co/t/no-mapping-found-for-filedname-in-order-to-sort-on/227730>\
**Category:** Elasticsearch\
**Created:** [April 13, 2020, 5:32am UTC](https://discuss.elastic.co/t/no-mapping-found-for-filedname-in-order-to-sort-on/227730 "2020-04-13T05:32:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![monica23334](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@monica23334](https://discuss.elastic.co/u/monica23334)\
**Post date:** [April 13, 2020, 5:32am UTC](https://discuss.elastic.co/t/no-mapping-found-for-filedname-in-order-to-sort-on/227730/1 "2020-04-13T05:32:02Z")

</div>

Hi,I am a new learner of Elastisearch.I use this api

`GET /logstash-kafka-2020.04.12/_mapping/ `

in Kibana to search my index mapping ,and it returns contain:

```auto
{
  "logstash-kafka-2020.04.12" : {
    "mappings" : {
      "dynamic_templates" : [
        {
          "message_field" : {
            "path_match" : "message",
            "match_mapping_type" : "string",
            "mapping" : {
              "norms" : false,
              "type" : "text"
            }
          }
        },
        {
          "string_fields" : {
            "match" : "*",
            "match_mapping_type" : "string",
            "mapping" : {
              "fields" : {
                "keyword" : {
                  "ignore_above" : 256,
                  "type" : "keyword"
                }
              },
              "norms" : false,
              "type" : "text"
            }
          }
        }
      ],
      "properties" : {
       
            "file_pdb" : {
              "type" : "text",
              "norms" : false,
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            }
         ...........       

```

I use this api to search docs:

```auto
GET logstash-kafka-2020.04.12/_search
{
  "query": {
    "match": {
      "file_pdb": "taskhost" 
    }
  },
   "sort": { "file_pdb.keyword": { "order": "desc" }},
  "aggs": {
    "file_pdbs": {
      "terms": {
        "field": "file_pdb.keyword" 
      }
    }
  }
}

```

but it returns with an error:

```auto
{
  "error": {
    "root_cause": [
      {
        "type": "query_shard_exception",
        "reason": "No mapping found for [file_pdb.keyword] in order to sort on",
        "index_uuid": "xsRz0xnUR4i-_9YMrtMZYg",
        "index": "logstash-kafka-2020.04.12"
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "logstash-kafka-2020.04.12",
        "node": "nVaZskjSRU6_I_OMkHdsTg",
        "reason": {
          "type": "query_shard_exception",
          "reason": "No mapping found for [file_pdb.keyword] in order to sort on",
          "index_uuid": "xsRz0xnUR4i-_9YMrtMZYg",
          "index": "logstash-kafka-2020.04.12"
        }
      }
    ]
  },
  "status": 400
}

```

From the mapping information,I do put a multi filed of "file\_pdb.keyword".Why can't I use sort to search it? Please help me, thank you!

---

<div class="post-metadata">

**Author:** ![monica23334](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@monica23334](https://discuss.elastic.co/u/monica23334)\
**Post date:** [April 13, 2020, 6:27am UTC](https://discuss.elastic.co/t/no-mapping-found-for-filedname-in-order-to-sort-on/227730/2 "2020-04-13T06:27:59Z")

</div>

I know the reason, because "file\_pdb.keyword" is a property of "data" object. So I should use "data.file\_pdb.keyword" for searching.

---

<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 11, 2020, 6:28am UTC](https://discuss.elastic.co/t/no-mapping-found-for-filedname-in-order-to-sort-on/227730/3 "2020-05-11T06:28:03Z")

</div>

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