# Multiple same values in a field

**URL:** <https://discuss.elastic.co/t/multiple-same-values-in-a-field/151862>\
**Category:** Elasticsearch\
**Created:** [October 10, 2018, 2:11pm UTC](https://discuss.elastic.co/t/multiple-same-values-in-a-field/151862 "2018-10-10T14:11:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mh20](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@mh20](https://discuss.elastic.co/u/mh20)\
**Post date:** [October 10, 2018, 2:11pm UTC](https://discuss.elastic.co/t/multiple-same-values-in-a-field/151862/1 "2018-10-10T14:11:07Z")

</div>

Hi, I have a document like this:

PUT twitter/\_doc/1  
{  
"user" : "kimchy",  
"post\_date" : "2009-11-15T14:12:12",  
"age" : [1, 1, 1, 1, 1, 1]  
}

What is difference between

"age" : [1, 1, 1, 1, 1, 1]  
and  
"age" : [1]

in elasticsearch inverted index? Is there any benefit in inserting distinct values in a field?

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [October 10, 2018, 4:12pm UTC](https://discuss.elastic.co/t/multiple-same-values-in-a-field/151862/2 "2018-10-10T16:12:18Z")

</div>

Hi mh20,

In the inverted index, the `1` will be stored as a term (in the term dictionary) and a single postings entry will be added for the document. The only difference will be in the term frequency stored for that document, since the term frequency of "1" for age: [1, 1, 1, 1, 1, 1] is 6 and the term frequency of "1" for age:[1] is 1.

---

<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:** [November 7, 2018, 4:16pm UTC](https://discuss.elastic.co/t/multiple-same-values-in-a-field/151862/3 "2018-11-07T16:16:13Z")

</div>

Closed on November 7, 2018, 4:16pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
