Multiple same values in a field

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?

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.

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