# Question about sorting non-indexed fields

**URL:** <https://discuss.elastic.co/t/question-about-sorting-non-indexed-fields/9264>\
**Category:** Elasticsearch\
**Created:** [October 7, 2012, 7:05am UTC](https://discuss.elastic.co/t/question-about-sorting-non-indexed-fields/9264 "2012-10-07T07:05:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jae](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jae/32/791_2.png) [@Jae](https://discuss.elastic.co/u/Jae)\
**Post date:** [October 7, 2012, 7:05am UTC](https://discuss.elastic.co/t/question-about-sorting-non-indexed-fields/9264/1 "2012-10-07T07:05:55Z")

</div>

Hi

I thought that I could sort with the date field which was not indexed but  
sorting didn't work.

I checked the sort value in the response and all were '0', which means, if  
I want to sort with the field, I should index that field? Am I correct?

This is not what I expected. I thought sorting was not related with the  
index.

Thank you  
Best, Jae

--

---

<div class="post-metadata">

**Author:** ![BillyEm](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@BillyEm](https://discuss.elastic.co/u/BillyEm)\
**Post date:** [October 8, 2012, 3:45am UTC](https://discuss.elastic.co/t/question-about-sorting-non-indexed-fields/9264/2 "2012-10-08T03:45:11Z")

</div>

Yes. The sorting is done internally with objects a that are NOT documents.  
Unindexed fields are only available when building Document. The  
\<\>Collector in Lucene fills the aforementioned objects from index fields,  
when it finds a qualifying dcoument it looks for position of the sort  
field in the field pos index  
and its not there. Probably doesn't even look ... if you think about it.

On Sunday, October 7, 2012 3:05:55 AM UTC-4, Jae wrote:

> Hi
> 
> I thought that I could sort with the date field which was not indexed but  
> sorting didn't work.
> 
> I checked the sort value in the response and all were '0', which means, if  
> I want to sort with the field, I should index that field? Am I correct?
> 
> This is not what I expected. I thought sorting was not related with the  
> index.
> 
> Thank you  
> Best, Jae

--

---

<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, 3:09am UTC](https://discuss.elastic.co/t/question-about-sorting-non-indexed-fields/9264/3 "2017-07-06T03:09:48Z")

</div>


