# Stored and term\_vector can impact hits order?

**URL:** https://discuss.elastic.co/t/stored-and-term-vector-can-impact-hits-order/3133
**Category:** Elasticsearch
**Created:** [July 21, 2010, 1:23pm UTC](https://discuss.elastic.co/t/stored-and-term-vector-can-impact-hits-order/3133 "2010-07-21T13:23:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)
#### Post date: [July 21, 2010, 1:23pm UTC](https://discuss.elastic.co/t/stored-and-term-vector-can-impact-hits-order/3133/1 "2010-07-21T13:23:52Z")

</div>

Hi,

May be it is just a random observation but I noticed interesting situation.  
I am running one server node with index having 4 shards (no replicas). Now,  
when I index data and issue a query like "+term1 term2" then I get some hits  
back. I noticed that two hits (out of the ten most relevant hits) switched  
positions if I changed mapping for "\_all" to { "store" : "yes",  
"term\_vector" : "with\_positions\_offsets" }.  
It is worth noting that both the hits have the same value of score but it  
seems as it was guarantied that if \_all is not stored and with no  
term\_vector then the order of those two documents is reversed.

Regards,  
Lukas

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [July 21, 2010, 5:41pm UTC](https://discuss.elastic.co/t/stored-and-term-vector-can-impact-hits-order/3133/2 "2010-07-21T17:41:43Z")

</div>

If they have the same score, then the order depends on several factors  
internal to how Lucene works. Not really sure why you care.

On Wed, Jul 21, 2010 at 4:23 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com) wrote:

> Hi,
> 
> May be it is just a random observation but I noticed interesting situation.  
> I am running one server node with index having 4 shards (no replicas). Now,  
> when I index data and issue a query like "+term1 term2" then I get some hits  
> back. I noticed that two hits (out of the ten most relevant hits) switched  
> positions if I changed mapping for "\_all" to { "store" : "yes",  
> "term\_vector" : "with\_positions\_offsets" }.  
> It is worth noting that both the hits have the same value of score but it  
> seems as it was guarantied that if \_all is not stored and with no  
> term\_vector then the order of those two documents is reversed.
> 
> Regards,  
> Lukas

---

<div class="post-metadata">

### Author: ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)
#### Post date: [July 21, 2010, 5:57pm UTC](https://discuss.elastic.co/t/stored-and-term-vector-can-impact-hits-order/3133/3 "2010-07-21T17:57:20Z")

</div>

Good to know that.  
I do not bother much about this, just noticed that.

Thanks,  
Lukas

On Wed, Jul 21, 2010 at 7:41 PM, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> If they have the same score, then the order depends on several factors  
> internal to how Lucene works. Not really sure why you care.
> 
> On Wed, Jul 21, 2010 at 4:23 PM, Lukáš Vlček [lukas.vlcek@gmail.com](mailto:lukas.vlcek@gmail.com)wrote:
> 
> > Hi,
> > 
> > May be it is just a random observation but I noticed interesting  
> > situation. I am running one server node with index having 4 shards (no  
> > replicas). Now, when I index data and issue a query like "+term1 term2" then  
> > I get some hits back. I noticed that two hits (out of the ten most relevant  
> > hits) switched positions if I changed mapping for "\_all" to { "store" :  
> > "yes", "term\_vector" : "with\_positions\_offsets" }.  
> > It is worth noting that both the hits have the same value of score but it  
> > seems as it was guarantied that if \_all is not stored and with no  
> > term\_vector then the order of those two documents is reversed.
> > 
> > Regards,  
> > Lukas

---

<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, 4:21am UTC](https://discuss.elastic.co/t/stored-and-term-vector-can-impact-hits-order/3133/4 "2017-07-06T04:21:52Z")

</div>


