# String Array Mapping for Exact Value

**URL:** <https://discuss.elastic.co/t/string-array-mapping-for-exact-value/48697>\
**Category:** Elasticsearch\
**Created:** [April 28, 2016, 3:09pm UTC](https://discuss.elastic.co/t/string-array-mapping-for-exact-value/48697 "2016-04-28T15:09:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlossada](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@jlossada](https://discuss.elastic.co/u/jlossada)\
**Post date:** [April 28, 2016, 3:09pm UTC](https://discuss.elastic.co/t/string-array-mapping-for-exact-value/48697/1 "2016-04-28T15:09:51Z")

</div>

I currently have this mapping, where categories is an array of strings.

"events": {  
"mappings": {  
"event": {  
"properties": {  
......  
"categories": {  
"type": "string",  
"index": "not\_analyzed"  
}  
.......  
}

It works great for searching and I have had no problem until I added this category "Sorting & Penning".  
For some reason when adding a & to the strings in the categoires I will get no results when searching.  
{  
"\_index" : "events",  
"\_type" : "event",  
"\_id" : "48",  
....  
"categories" : ["Playdays", "Sorting & Penning"],  
....  
}  
But if I change the category name to Sort and Penning, then when I a search I go get all the expected results. The problem is when I add the &. I thought that my making it "index": "not\_analyzed" I would be search as exact values, which is what I need.

This is an example of the query used

'query': {  
'bool':  
{'filter': [  
{'term': {'categories': 'Sorting & Penning'}}],  
'must': [  
{  
'match\_all': {}  
}  
]  
}  
}

---

<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:** [July 5, 2017, 10:55pm UTC](https://discuss.elastic.co/t/string-array-mapping-for-exact-value/48697/2 "2017-07-05T22:55:30Z")

</div>

Closed on July 5, 2017, 10:55pm UTC


