# Elastic Search Won't Match For Arrays

**URL:** <https://discuss.elastic.co/t/elastic-search-wont-match-for-arrays/34548>\
**Category:** Elasticsearch\
**Created:** [November 13, 2015, 6:25pm UTC](https://discuss.elastic.co/t/elastic-search-wont-match-for-arrays/34548 "2015-11-13T18:25:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![walker6o9](https://avatars.discourse-cdn.com/v4/letter/w/4bbf92/32.png) [@walker6o9](https://discuss.elastic.co/u/walker6o9)\
**Post date:** [November 13, 2015, 6:25pm UTC](https://discuss.elastic.co/t/elastic-search-wont-match-for-arrays/34548/1 "2015-11-13T18:25:05Z")

</div>

I'm trying to search a document with the following structure:

{  
"\_index": "XXX",  
"\_type": "business",  
"\_id": "1252809",  
"\_score": 1,  
"\_source": {  
"url": "[http://Samuraijapanese.com](http://Samuraijapanese.com)",  
"raw\_name": "Samurai Restaurant",  
"categories": [  
{  
"name": "Cafe"  
},  
{  
"name": "Cajun Restaurant"  
},  
{  
"name": "Candy Stores"  
}  
],  
"location": {  
"lat": "32.9948649",  
"lon": "-117.2528171"  
},  
"address": "979 Lomas Santa Fe Dr",  
"zip": "92075",  
"phone": "8584810032",  
"short\_name": "samurai-restaurant",  
"name": "Samurai Restaurant",  
"apt": "",  
"state": "CA",  
"stdhours": "",  
"city": "Solana Beach",  
"hours": "",  
"yelp": "",  
"twitter": "",  
"closed": 0  
}  
}  
Searching it for url, raw\_name, address, etc, all work, but searching the categories returns nothing. I'm trying to search like so: If I switch anything else in for categories.name it works:

"query": {  
"filtered" : {  
"filter" : {  
"geo\_distance" : {  
"location" : {  
"lon" : "-117.15726",  
"lat" : "32.71533"  
},  
"distance" : "5mi"  
}  
},  
"query" : {  
"multi\_match" : {  
"query" : "Cafe",  
"fields" : [  
"categories.name"  
]  
}  
}  
}

},  
"sort": [  
{  
"\_score" : {  
"order" : "desc"  
}  
},  
{  
"\_geo\_distance": {  
"location": {  
"lat": 32.71533,  
"lon": -117.15726  
},  
"order": "asc",  
"sort\_mode": "min"  
}  
}  
],  
"script\_fields": {  
"distance\_from\_origin": {  
"script": "doc['location'].arcDistanceInKm(32.71533,-117.15726)"  
}  
},  
"fields": ["\_source"],  
"from": 0,  
"size": 10  
}  
If I switch out, for example, categories.name with address, and change the search term to Lomas, it returns the result

---

<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, 11:38pm UTC](https://discuss.elastic.co/t/elastic-search-wont-match-for-arrays/34548/2 "2017-07-05T23:38:35Z")

</div>


