# Elasticsearch

**URL:** <https://discuss.elastic.co/t/elasticsearch/245461>\
**Category:** Elasticsearch\
**Created:** [August 18, 2020, 3:46pm UTC](https://discuss.elastic.co/t/elasticsearch/245461 "2020-08-18T15:46:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_said](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ben_said/32/48319_2.png) [@Ben\_said](https://discuss.elastic.co/u/Ben_said)\
**Post date:** [August 18, 2020, 3:46pm UTC](https://discuss.elastic.co/t/elasticsearch/245461/1 "2020-08-18T15:46:32Z")

</div>

can someone help me please ? i try to set fileddata to true but its failed.

{  
"took": 26,  
"timed\_out": false,  
"\_shards": {  
"total": 2,  
"successful": 1,  
"skipped": 1,  
"failed": 1,  
"failures": [  
{  
"shard": 0,  
"index": "metricbeat-2020.08.18",  
"node": "NMIiS4rmTO21i\_rUUjo3lw",  
"reason": {  
"type": "illegal\_argument\_exception",  
"reason": "Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [host.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory."  
}  
}  
]  
},  
"hits": {  
"total": 0,  
"max\_score": 0,  
"hits":   
}  
}

i try whit this this commande but it doesn't work.

curl -PUT [http://XXXX:9200/metricbeat-2020.08.18/\_mapping](http://XXXX:9200/metricbeat-2020.08.18/_mapping)  
{  
"properties": {  
"yourfield": {  
"type": "text",  
"fielddata": true  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![sunxi](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@sunxi](https://discuss.elastic.co/u/sunxi)\
**Post date:** [August 19, 2020, 3:47am UTC](https://discuss.elastic.co/t/elasticsearch/245461/2 "2020-08-19T03:47:35Z")

</div>

> [@Ben\_said](#):
>
> Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [host.name] in order to load field data by uninverting the inverted index. Note that this can use significant memory.

you can see the url:[Text type family | Elasticsearch Guide [8.11] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html)

 ![1](https://us1.discourse-cdn.com/elastic/original/3X/7/2/72bd8c4b8e992ef6ff1302d9560aa55b31e35334.png)  
 ![2](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e98ea2f093191cd561f53e87b94664b3ab402503.png)

---

<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:** [September 16, 2020, 3:47am UTC](https://discuss.elastic.co/t/elasticsearch/245461/3 "2020-09-16T03:47:39Z")

</div>

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