Doc.length starts counting approximately starting from 41 tokens

Hi all !

I founded that doc.length variable starts counting approximately starting from 41 tokens in a document.
Could anyone prompt, is it expected behavior ?
I am trying to use scripted similarity and it's important to get exact count of tokens in a document.
I also attach a diagram with the results of my testing.


Thanks !

My ES version: 7.8.1

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