Understand Explain API scoring

I'm trying to understand the Explain API scoring in the elastic documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html

When I couldn't figure it out on my own simple index with just a couple documents, I tried to reproduce the calculation on the above documentation page.

In the example, it shows a "value" of 1.3862944 with the description: "idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5))". Under "details" it gives the following values for the fields: docFreq: 1.0, docCount: 5.0

Using the provided docFreq and docCount values, I compute this to be: log(1 + (5.0 - 1.0 + 0.5) / (1.0 + 0.5)) = 0.602 which is not the same as the 1.3862944 in the example.

I can't get any of the values to match up.

Am I reading it incorrectly?


From StackOverflow: the answer is that the logarithm calculation is the natural logarithm and not the base 10 logarithm.

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