# AvgFieldLength seem wrong

**URL:** <https://discuss.elastic.co/t/avgfieldlength-seem-wrong/957>\
**Category:** Elasticsearch\
**Created:** [May 20, 2015, 9:50am UTC](https://discuss.elastic.co/t/avgfieldlength-seem-wrong/957 "2015-05-20T09:50:18Z")\
**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:50am UTC](https://discuss.elastic.co/t/avgfieldlength-seem-wrong/957/1 "2015-05-20T09:50:18Z")

</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.2However 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'},}}}}

---

<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/957/2 "2017-07-06T00:13:06Z")

</div>


