Elasticsearch feature for rating

Hi, what feature does Elastic Search provide for rating? For example, I have a restaurant application and I want to update the restaurant rating and how can I sort the query on the basis of rating for nearby restaurants.

If you have a rate field in your document, you can use this for example: Function score query | Elasticsearch Guide [7.14] | Elastic

okay and what type should i use for rating. i tried integer and floating but it gave me error while adding values to it.

Moreover what about ranking evaluation api, can i also use for rating?

No, that API doesn't adress the use case of adding ratings to individual documents and then querying for it. It is rather an API for rating sets of search results for their retrival quality based on some previously collected gold standard. See How to Use the Ranking Evaluation API in Elasticsearch | Elastic Blog for details.

Yes, got it.

The question is,lets suppose i have an restaurant application and there user gives rating to the restaurant. Lets suppose there is restaurant abc and its rating changes based on user rating.

How Elastic Search calculate the average rating and ingest the changed rating to the document automatically. is there any feature or property in elastic search?

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