# Cannot sort on nested, multi\_field, not\_analyzed field

**URL:** <https://discuss.elastic.co/t/cannot-sort-on-nested-multi-field-not-analyzed-field/14175>\
**Category:** Elasticsearch\
**Created:** [October 30, 2013, 4:58pm UTC](https://discuss.elastic.co/t/cannot-sort-on-nested-multi-field-not-analyzed-field/14175 "2013-10-30T16:58:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwisarts](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kwisarts/32/2004_2.png) [@kwisarts](https://discuss.elastic.co/u/kwisarts)\
**Post date:** [October 30, 2013, 4:58pm UTC](https://discuss.elastic.co/t/cannot-sort-on-nested-multi-field-not-analyzed-field/14175/1 "2013-10-30T16:58:56Z")

</div>

Good day,

I've been trying for a while to sort on a nested, multi\_field, not\_analyzed  
field of documents in our index.

Here's the relevant part of my mapping. Please focus on the name.na field

"booth": {

> ```
> "properties": {
> "details" : {
> "type": "nested",
> "properties": {
> "locale" : {
> "type": "string",
> "index": "not_analyzed"
> },
> "name": {
> "type": "multi_field",
> "fields": {
> "na": {
> "type": "string",
> "index": "not_analyzed"
> },
> "standard": {
> "type": "string",
> "analyzer": "full_name"
> },
> "ngrams": {
> "search_analyzer": "full_name",
> "index_analyzer": "ngrammed",
> "type": "string"
> },
> "keyword": {
> "type": "string",
> "analyzer": "asis"
> }
> }
> },
> "description": {
> "type": "string",
> "analyzer": "full_name"
> }
> }
> },
> 
> ```

Both name and description fields contain simple text only.  
For illustration purposes, let's consider I was running just the sort:

{

> "sort": [  
> {  
> "details.name.na": {  
> "order": "desc"  
> }  
> }  
> ]  
> }

Sorting on that field doesn't work, which is made pretty clear by  
elasticsearch's response:

> - sort: [
> 
> - null
> 
> - ]

Now, sorting on the details.description field does work (but that's not  
what I want).

Any ideas what I'm doing wrong here?

Thanks,  
David

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 2:09am UTC](https://discuss.elastic.co/t/cannot-sort-on-nested-multi-field-not-analyzed-field/14175/2 "2017-07-06T02:09:43Z")

</div>


