1
votes

I am using NEST (.NET client) to query Elastic. Elastic uses a property - _score to compute the score of a document for a search query. The _score is a property value between 0 and 1.

With NEST, the metadata can be retrieved from the search response using the Hits Collection. Each Hit has a property called Score. The Score available in this property is greater than 1. Usually, it is a number like 2.5, 5.1, 7.3 etc.

What is the relation between the _score computed by Elastic and the Score available in the Hits Property of NEST?

1
We are seeing the same thing. We produce a query (SearchDescriptor) and then get the raw string (System.Text.Encoding.UTF8.GetString(client.Serializer.Serialize(searchDescriptor));) let the code execute and put the above string into Postman and we see the scores are very different. In Postman 0.025489395 and in code we see 4.50289430. Why is there a difference?!?!?! - JoeBear

1 Answers

1
votes

The value of _score field in Elasticsearch search response hits is exactly what Hit.Score represents. Value of _score is not bound between 0 and 1. It can be greater than 1.

Quoting below from official Elastic doc:

The relevance score of each document is represented by a positive floating-point number called the _score. The higher the _score, the more relevant the document.