O'Reilly logo

Instant Lucene.NET by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Lucene.NET's scoring (Become an expert)

Query results are assigned a score that is a representation of how good of a match that document is to the query. Higher numeric values represent "better" results. But how is this score determined? This recipe gives an explanation on how Lucene.NET arrives at a score and how you can examine the score to figure out exactly how the value was calculated.

How to do it…

  1. The score of a hit in a query result is a floating-point value >= 0.0. This value is computed via an equation derived from theory in information retrieval:

    Σt in q (t f (t in d ) idf (t) boost(t.field in d ) lengthNorm(t.field in d )) coord(q,d ) queryNorm(q)

    Let's look at each of the terms in the equation and how they factor into ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required