# "No mapping found for \[@timestamp\] in order to sort on"

**URL:** <https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855>\
**Category:** Elasticsearch\
**Created:** [September 21, 2022, 10:39am UTC](https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855 "2022-09-21T10:39:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarindra\_Therese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sarindra_therese/32/103180_2.png) [@Sarindra\_Therese](https://discuss.elastic.co/u/Sarindra_Therese)\
**Post date:** [September 21, 2022, 10:39am UTC](https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855/1 "2022-09-21T10:39:30Z")

</div>

Hey, I have this error:

`{"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [@timestamp] in order to sort on","index_uuid":"0qKrRe3tQbKYhi5ps_WcCw","index":"products"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"can_match","grouped":true,"failed_shards":[{"shard":0,"index":"products","node":"asmTRFlgThS7kBU6yyCJzA","reason":{"type":"query_shard_exception","reason":"No mapping found for [@timestamp] in order to sort on","index_uuid":"0qKrRe3tQbKYhi5ps_WcCw","index":"products"}}]},"status":400}`

So what's wrong?

```auto
PUT /products
{
  "settings": {
    "number_of_replicas": 2,
    "number_of_shards": 2
  }
}

```

that's my products index:

```auto
POST /products/_doc
{
  "name": "Coffee Maker",
  "price": 64
}

POST /products/_doc
{
  "name": "Ice Tea",
  "price": 50
}

POST /products/_doc
{
  "name": "products",
  "price": 10
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 21, 2022, 10:42am UTC](https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855/2 "2022-09-21T10:42:02Z")

</div>

You have no timestamp field.

---

<div class="post-metadata">

**Author:** ![Sarindra\_Therese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sarindra_therese/32/103180_2.png) [@Sarindra\_Therese](https://discuss.elastic.co/u/Sarindra_Therese)\
**Post date:** [September 21, 2022, 10:59am UTC](https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855/3 "2022-09-21T10:59:52Z")

</div>

how to create it?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 21, 2022, 11:07am UTC](https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855/4 "2022-09-21T11:07:16Z")

</div>

Add it to your document, you may need to use mappings when you put the index though, to make sure it stored correctly (ie not as a string).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 21, 2022, 11:56am UTC](https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855/5 "2022-09-21T11:56:24Z")

</div>

Actually, may be you don't need it.

I guess the error message is coming from Kibana? Or is it coming from another place?  
If it comes from kibana, when you create the index pattern, just choose "I don't have a timestamp".

---

<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:** [October 19, 2022, 11:57am UTC](https://discuss.elastic.co/t/no-mapping-found-for-timestamp-in-order-to-sort-on/314855/6 "2022-10-19T11:57:19Z")

</div>

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