# Problem when creating an index not analyzed, to perform term searches in texts

**URL:** <https://discuss.elastic.co/t/problem-when-creating-an-index-not-analyzed-to-perform-term-searches-in-texts/173056>\
**Category:** Elasticsearch\
**Created:** [March 19, 2019, 9:06pm UTC](https://discuss.elastic.co/t/problem-when-creating-an-index-not-analyzed-to-perform-term-searches-in-texts/173056 "2019-03-19T21:06:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elvis\_Goncalves](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elvis_goncalves/32/42379_2.png) [@Elvis\_Goncalves](https://discuss.elastic.co/u/Elvis_Goncalves)\
**Post date:** [March 19, 2019, 9:06pm UTC](https://discuss.elastic.co/t/problem-when-creating-an-index-not-analyzed-to-perform-term-searches-in-texts/173056/1 "2019-03-19T21:06:45Z")

</div>

Try to create an index with a field that is not analyzed in order to perform a string search. But when I try to create the index it generates errors.

In this way I create the index:

PUT / contents  
{

"mappings": {

"category": {

"\_all": {"enabled": false},

"\_source": {"compressed": true},

"properties": {

"name": {"type": "text", "index": "analyzed"}

}

}

}

}

and it generates me error:

{  
"error": {  
"root\_cause": [  
{  
"type": "mapper\_parsing\_exception",  
"reason": "Failed to parse mapping [category]: Could not convert [name.index] to boolean"  
}  
],  
"type": "mapper\_parsing\_exception",  
"reason": "Failed to parse mapping [category]: Could not convert [name.index] to boolean",  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "Could not convert [name.index] to boolean",  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "Failed to parse value [analyzed] as only [true] or [false] are allowed."  
}  
}  
},  
"status": 400  
}

How it should create that certain fields are not analyzed so you can search the text strings.

---

<div class="post-metadata">

**Author:** ![glenacota](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glenacota/32/41367_2.png) [@glenacota](https://discuss.elastic.co/u/glenacota)\
**Post date:** [March 19, 2019, 9:14pm UTC](https://discuss.elastic.co/t/problem-when-creating-an-index-not-analyzed-to-perform-term-searches-in-texts/173056/2 "2019-03-19T21:14:45Z")

</div>

Hi, since Elasticsearch version 5.x, you can use the `keyword` datatype for not analysed strings ([https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/keyword.html)).

---

<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 16, 2019, 9:14pm UTC](https://discuss.elastic.co/t/problem-when-creating-an-index-not-analyzed-to-perform-term-searches-in-texts/173056/3 "2019-04-16T21:14:52Z")

</div>

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