# Does 0.90.0 support sorting on string fields with missing set to \_last?

**URL:** <https://discuss.elastic.co/t/does-0-90-0-support-sorting-on-string-fields-with-missing-set-to--last/12070>\
**Category:** Elasticsearch\
**Created:** [May 22, 2013, 10:08am UTC](https://discuss.elastic.co/t/does-0-90-0-support-sorting-on-string-fields-with-missing-set-to--last/12070 "2013-05-22T10:08:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luk\_Morbee](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@Luk\_Morbee](https://discuss.elastic.co/u/Luk_Morbee)\
**Post date:** [May 22, 2013, 10:08am UTC](https://discuss.elastic.co/t/does-0-90-0-support-sorting-on-string-fields-with-missing-set-to--last/12070/1 "2013-05-22T10:08:56Z")

</div>

Hi,

Issue #896 [https://github.com/elasticsearch/elasticsearch/issues/896](https://github.com/elasticsearch/elasticsearch/issues/896)(Sort: Support "missing" specific handling, include \_last, \_first, and  
custom value for string values) is closed.  
clintongormley [https://github.com/clintongormley](https://github.com/clintongormley) commented that this is  
supported for numbers, dates, _strings_, and geo-locations as of 0.90.0.RC2.

I downloaded the 0.90.0 version but hits sorted on missing string fields  
still end up first.

Suppose I have the following mapping:

"user":{  
"type":"string",  
"index" : "not\_analyzed"  
}

Then hits with missing the user field still ends up first if I were to run  
the following query:

{  
"query" : {  
...  
},  
"sort" : [  
{ "user" : {"order" : "asc", "missing" : "\_last"} }  
]  
}

According to the ElasticSearch quide[http://www.elasticsearch.org/guide/reference/api/search/sort/](http://www.elasticsearch.org/guide/reference/api/search/sort/)the missing feature only applies to numeric fields.  
So I am a bit confused.  
Does 0.90.0 support sorting on string fields with missing set to \_last?  
If not, is this an enhancement that will be implemented any time soon?

Thx,  
Luk

--  
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:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [May 23, 2013, 10:27am UTC](https://discuss.elastic.co/t/does-0-90-0-support-sorting-on-string-fields-with-missing-set-to--last/12070/2 "2013-05-23T10:27:35Z")

</div>

Hi Luk

Hmmm, I'm not sure why I thought it had been added in 0.90.0.RC2. I've  
looked through the issues list and can't find it.

I'll ask.

clint

On Wednesday, 22 May 2013 12:08:56 UTC+2, Luk Morbee wrote:

> Hi,
> 
> Issue #896 [https://github.com/elasticsearch/elasticsearch/issues/896](https://github.com/elasticsearch/elasticsearch/issues/896)(Sort: Support "missing" specific handling, include \_last, \_first, and  
> custom value for string values) is closed.  
> clintongormley [https://github.com/clintongormley](https://github.com/clintongormley) commented that this is  
> supported for numbers, dates, _strings_, and geo-locations as of  
> 0.90.0.RC2.
> 
> I downloaded the 0.90.0 version but hits sorted on missing string fields  
> still end up first.
> 
> Suppose I have the following mapping:
> 
> "user":{  
> "type":"string",  
> "index" : "not\_analyzed"  
> }
> 
> Then hits with missing the user field still ends up first if I were to run  
> the following query:
> 
> {  
> "query" : {  
> ...  
> },  
> "sort" : [  
> { "user" : {"order" : "asc", "missing" : "\_last"} }  
> ]  
> }
> 
> According to the Elasticsearch quide[http://www.elasticsearch.org/guide/reference/api/search/sort/](http://www.elasticsearch.org/guide/reference/api/search/sort/)the missing feature only applies to numeric fields.  
> So I am a bit confused.  
> Does 0.90.0 support sorting on string fields with missing set to \_last?  
> If not, is this an enhancement that will be implemented any time soon?
> 
> Thx,  
> Luk

--  
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:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [May 23, 2013, 10:53am UTC](https://discuss.elastic.co/t/does-0-90-0-support-sorting-on-string-fields-with-missing-set-to--last/12070/3 "2013-05-23T10:53:43Z")

</div>

Apparently it can be supported but isn't yet. I've reopened the issue

clint

On 23 May 2013 12:27, Clinton Gormley [clint@traveljury.com](mailto:clint@traveljury.com) wrote:

> Hi Luk
> 
> Hmmm, I'm not sure why I thought it had been added in 0.90.0.RC2. I've  
> looked through the issues list and can't find it.
> 
> I'll ask.
> 
> clint
> 
> On Wednesday, 22 May 2013 12:08:56 UTC+2, Luk Morbee wrote:
> 
> > Hi,
> > 
> > Issue #896 [https://github.com/elasticsearch/elasticsearch/issues/896](https://github.com/elasticsearch/elasticsearch/issues/896)(Sort: Support "missing" specific handling, include \_last, \_first, and  
> > custom value for string values) is closed.  
> > clintongormley [https://github.com/clintongormley](https://github.com/clintongormley) commented that this  
> > is supported for numbers, dates, _strings_, and geo-locations as of  
> > 0.90.0.RC2.
> > 
> > I downloaded the 0.90.0 version but hits sorted on missing string fields  
> > still end up first.
> > 
> > Suppose I have the following mapping:
> > 
> > "user":{  
> > "type":"string",  
> > "index" : "not\_analyzed"  
> > }
> > 
> > Then hits with missing the user field still ends up first if I were to  
> > run the following query:
> > 
> > {  
> > "query" : {  
> > ...  
> > },  
> > "sort" : [  
> > { "user" : {"order" : "asc", "missing" : "\_last"} }  
> > ]  
> > }
> > 
> > According to the Elasticsearch quide[http://www.elasticsearch.org/guide/reference/api/search/sort/](http://www.elasticsearch.org/guide/reference/api/search/sort/)the missing feature only applies to numeric fields.  
> > So I am a bit confused.  
> > Does 0.90.0 support sorting on string fields with missing set to \_last?  
> > If not, is this an enhancement that will be implemented any time soon?
> > 
> > Thx,  
> > Luk
> > 
> > --  
> > 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).

--  
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:** ![Luk\_Morbee](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@Luk\_Morbee](https://discuss.elastic.co/u/Luk_Morbee)\
**Post date:** [May 23, 2013, 11:33am UTC](https://discuss.elastic.co/t/does-0-90-0-support-sorting-on-string-fields-with-missing-set-to--last/12070/4 "2013-05-23T11:33:23Z")

</div>

Hi Clint,

Thanks for the feedback,

Luk

On Thursday, May 23, 2013 12:53:43 PM UTC+2, Clinton Gormley wrote:

> Apparently it can be supported but isn't yet. I've reopened the issue
> 
> clint
> 
> On 23 May 2013 12:27, Clinton Gormley \<[cl...@traveljury.com](mailto:cl...@traveljury.com) \<javascript:\>\>wrote:
> 
> > Hi Luk
> > 
> > Hmmm, I'm not sure why I thought it had been added in 0.90.0.RC2. I've  
> > looked through the issues list and can't find it.
> > 
> > I'll ask.
> > 
> > clint
> > 
> > On Wednesday, 22 May 2013 12:08:56 UTC+2, Luk Morbee wrote:
> > 
> > > Hi,
> > > 
> > > Issue #896 [https://github.com/elasticsearch/elasticsearch/issues/896](https://github.com/elasticsearch/elasticsearch/issues/896)(Sort: Support "missing" specific handling, include \_last, \_first, and  
> > > custom value for string values) is closed.  
> > > clintongormley [https://github.com/clintongormley](https://github.com/clintongormley) commented that this  
> > > is supported for numbers, dates, _strings_, and geo-locations as of  
> > > 0.90.0.RC2.
> > > 
> > > I downloaded the 0.90.0 version but hits sorted on missing string fields  
> > > still end up first.
> > > 
> > > Suppose I have the following mapping:
> > > 
> > > "user":{  
> > > "type":"string",  
> > > "index" : "not\_analyzed"  
> > > }
> > > 
> > > Then hits with missing the user field still ends up first if I were to  
> > > run the following query:
> > > 
> > > {  
> > > "query" : {  
> > > ...  
> > > },  
> > > "sort" : [  
> > > { "user" : {"order" : "asc", "missing" : "\_last"} }  
> > > ]  
> > > }
> > > 
> > > According to the Elasticsearch quide[http://www.elasticsearch.org/guide/reference/api/search/sort/](http://www.elasticsearch.org/guide/reference/api/search/sort/)the missing feature only applies to numeric fields.  
> > > So I am a bit confused.  
> > > Does 0.90.0 support sorting on string fields with missing set to \_last?  
> > > If not, is this an enhancement that will be implemented any time soon?
> > > 
> > > Thx,  
> > > Luk
> > > 
> > > --  
> > > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:35am UTC](https://discuss.elastic.co/t/does-0-90-0-support-sorting-on-string-fields-with-missing-set-to--last/12070/5 "2017-07-06T02:35:07Z")

</div>


