# New index\_options vs term\_vector?

**URL:** https://discuss.elastic.co/t/new-index-options-vs-term-vector/9470
**Category:** Elasticsearch
**Created:** [October 25, 2012, 7:10am UTC](https://discuss.elastic.co/t/new-index-options-vs-term-vector/9470 "2012-10-25T07:10:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)
#### Post date: [October 25, 2012, 7:10am UTC](https://discuss.elastic.co/t/new-index-options-vs-term-vector/9470/1 "2012-10-25T07:10:09Z")

</div>

Hi,

Can someone be kind enough to explain the difference between term\_vector  
and the new index\_options (0.20) parameter? Not sure to understand what  
docs, freqs and positions means.

Thanks,

-- Tanguy  
Twitter: @tlrx

> **[tlrx (Tanguy Leroux)](https://github.com/tlrx)**
>
> tlrx has 22 repositories available. Follow their code on GitHub.

--

---

<div class="post-metadata">

### Author: ![simonw\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simonw_2/32/1130_2.png) [@simonw\_2](https://discuss.elastic.co/u/simonw_2)
#### Post date: [October 25, 2012, 8:03am UTC](https://discuss.elastic.co/t/new-index-options-vs-term-vector/9470/2 "2012-10-25T08:03:55Z")

</div>

Hey Tanguy,

first of all index\_options & term\_vectors are two totally different things.  
index\_options are "options" for the index you are searching on, a  
datastructure that holds "terms" to document lists (posting lists).  
TermVectors are a datastructure that gives you the "terms" for a given  
document and in addition their position in the document as well as their  
start and end character offsets. Now the index (each field has such an  
index) holds a sorted list of terms and each term points to a posting list.  
these posting lists are a list of documents that contain the term. On the  
posting list you can also store information like frequencies (how often did  
term Y occur in document X -\> useful for scoring) as well as "positions"  
(at which position did term Y occur in document X -\> this is required fo  
phrase & span queries).

if you have for instance a field that you only use for filtering you don't  
need freqs and postions so documents only will do the job. In an index the  
position information is the biggest piece of data usually aside stored  
fields. If you don't do phrase queries or spans you don't need them at all  
so safe the disk space and improve perf by only use docs and freqs. In  
previous version it wasn't possible to have only freqs but no positions  
(index\_options supersede omit\_term\_frequencies\_and\_positions) so this is an  
improvement overall since the most common usecase might only need freqs but  
no positions.

hope this makes more sense to you now.

simon

On Thursday, October 25, 2012 9:10:09 AM UTC+2, Tanguy wrote:

> Hi,
> 
> Can someone be kind enough to explain the difference between term\_vector  
> and the new index\_options (0.20) parameter? Not sure to understand what  
> docs, freqs and positions means.
> 
> Thanks,
> 
> -- Tanguy  
> Twitter: @tlrx  
> [tlrx (Tanguy Leroux) · GitHub](https://github.com/tlrx)

--

---

<div class="post-metadata">

### Author: ![Tanguy1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanguy1/32/1749_2.png) [@Tanguy1](https://discuss.elastic.co/u/Tanguy1)
#### Post date: [October 25, 2012, 9:38am UTC](https://discuss.elastic.co/t/new-index-options-vs-term-vector/9470/3 "2012-10-25T09:38:04Z")

</div>

Thanks Simon, it's clear for me now :o)

-- Tanguy

Le jeudi 25 octobre 2012 10:03:55 UTC+2, simonw a écrit :

> Hey Tanguy,
> 
> first of all index\_options & term\_vectors are two totally different  
> things. index\_options are "options" for the index you are searching on, a  
> datastructure that holds "terms" to document lists (posting lists).  
> TermVectors are a datastructure that gives you the "terms" for a given  
> document and in addition their position in the document as well as their  
> start and end character offsets. Now the index (each field has such an  
> index) holds a sorted list of terms and each term points to a posting list.  
> these posting lists are a list of documents that contain the term. On the  
> posting list you can also store information like frequencies (how often did  
> term Y occur in document X -\> useful for scoring) as well as "positions"  
> (at which position did term Y occur in document X -\> this is required fo  
> phrase & span queries).
> 
> if you have for instance a field that you only use for filtering you don't  
> need freqs and postions so documents only will do the job. In an index the  
> position information is the biggest piece of data usually aside stored  
> fields. If you don't do phrase queries or spans you don't need them at all  
> so safe the disk space and improve perf by only use docs and freqs. In  
> previous version it wasn't possible to have only freqs but no positions  
> (index\_options supersede omit\_term\_frequencies\_and\_positions) so this is an  
> improvement overall since the most common usecase might only need freqs but  
> no positions.
> 
> hope this makes more sense to you now.
> 
> simon
> 
> On Thursday, October 25, 2012 9:10:09 AM UTC+2, Tanguy wrote:
> 
> > Hi,
> > 
> > Can someone be kind enough to explain the difference between term\_vector  
> > and the new index\_options (0.20) parameter? Not sure to understand what  
> > docs, freqs and positions means.
> > 
> > Thanks,
> > 
> > -- Tanguy  
> > Twitter: @tlrx  
> > [tlrx (Tanguy Leroux) · GitHub](https://github.com/tlrx)

--

---

<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:07am UTC](https://discuss.elastic.co/t/new-index-options-vs-term-vector/9470/4 "2017-07-06T03:07:17Z")

</div>


