# IDF calculation in Elasticsearch 7.0

**URL:** <https://discuss.elastic.co/t/idf-calculation-in-elasticsearch-7-0/178362>\
**Category:** Elasticsearch\
**Created:** [April 25, 2019, 5:15am UTC](https://discuss.elastic.co/t/idf-calculation-in-elasticsearch-7-0/178362 "2019-04-25T05:15:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harsha\_Yerasi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/harsha_yerasi/32/42985_2.png) [@Harsha\_Yerasi](https://discuss.elastic.co/u/Harsha_Yerasi)\
**Post date:** [April 25, 2019, 5:15am UTC](https://discuss.elastic.co/t/idf-calculation-in-elasticsearch-7-0/178362/1 "2019-04-25T05:15:47Z")

</div>

Hi,

I am unable to understand n and N that are being used to calculate IDF.

```
{
                          "value" : 1.1631508,
                          "description" : "idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
                          "details" : [
                            {
                              "value" : 2,
                              "description" : "n, number of documents containing term",
                              "details" : []
                            },
                            {
                              "value" : 7,
                              "description" : "N, total number of documents with field",
                              "details" : []
                            }
                          ]
                        }

```

Can someone clarify me what n and N are?

---

<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:** [May 23, 2019, 5:15am UTC](https://discuss.elastic.co/t/idf-calculation-in-elasticsearch-7-0/178362/2 "2019-05-23T05:15:49Z")

</div>

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