vijayst
vijayst

Reputation: 21856

What is the relation between Elastic _score and the NEST Score property in Hits?

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?

Upvotes: 1

Views: 583

Answers (1)

bittusarkar
bittusarkar

Reputation: 6357

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.

Upvotes: 1

Related Questions