# AvgFieldLength seem wrong

**URL:** <https://discuss.elastic.co/t/avgfieldlength-seem-wrong/23652>\
**Category:** Elasticsearch\
**Created:** [May 20, 2015, 9:41am UTC](https://discuss.elastic.co/t/avgfieldlength-seem-wrong/23652 "2015-05-20T09:41:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dori\_Reichmann](https://avatars.discourse-cdn.com/v4/letter/d/96bed5/32.png) [@Dori\_Reichmann](https://discuss.elastic.co/u/Dori_Reichmann)\
**Post date:** [May 20, 2015, 9:41am UTC](https://discuss.elastic.co/t/avgfieldlength-seem-wrong/23652/1 "2015-05-20T09:41:49Z")

</div>

I am running an index with bm25 similarity over a field named title.

When I (manually) calculate the teh average field length I find ~10.2  
However when I use elastic search explain I get much smaller. This ruins  
the score expected calculation

Any clue what goes wrong ?

_Example of the result:_

{'description': 'weight(title:5 in 72454) [PerFieldSimilarity], result of:',  
'details': [{'description': 'score(doc=72454,freq=1.0 =  
termFreq=1.0\n), product of:',  
'details': [{'description': 'idf(docFreq=3040, maxDocs=901722)',  
'value': 5.6922855},  
{'description': 'tfNorm, computed from:',  
'details': [{'description': 'termFreq=1.0', 'value': 1.0},  
{'description': 'parameter k1', 'value': 2.0},  
{'description': 'parameter b', 'value': 0.75},  
{'_description': 'avgFieldLength', 'value': 2.2184565_},  
{'description': 'fieldLength', 'value': 5.2244897}],  
'value': 0.5961232}],  
'value': 3.3933036}],  
'value': 3.3933036}],  
'value': 11.2237425},

\*The setting I use : \*

{'settings': {'index': {'creation\_date': '1430658049103',  
'index': {'store': {'type': 'default'}},  
'number\_of\_replicas': 0,  
'number\_of\_shards': '8',  
'my\_bm25\_t': {'b': '0.75',  
'discount\_overlaps': 'false',  
'k1': '2.0',  
'type': 'BM25'}}  
}}  
{'mappings': {product': {'\_ttl': {'enabled': True},  
'properties': {  
'title': {'analyzer': 'english',  
'similarity': 'my\_bm25\_t',  
'type': 'string'}  
'brand': {'index': 'not\_analyzed', 'type': 'string'},  
'condition': {'index': 'not\_analyzed', 'type': 'string'},  
}}}}

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/743ef0c4-9dcb-4883-8e3f-3329c6b6cb24%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/743ef0c4-9dcb-4883-8e3f-3329c6b6cb24%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:13am UTC](https://discuss.elastic.co/t/avgfieldlength-seem-wrong/23652/2 "2017-07-06T00:13:06Z")

</div>


