Search for relevance
Serverless Stack
Elasticsearch assigns a relevancy score to each document based on how well it matches your query. Sorting by this score helps you identify the most relevant results quickly. This guide shows how to use Discover to sort documents by relevance score, putting the best matches at the top of your results.
This example uses the sample flights data set, or you can use your own data.
In Discover, open the data view dropdown, and select the data that you want to work with.
For the sample flights data, set the data view to Kibana Sample Data Flights.
Run your search. For the sample data, try:
Warsaw OR Venice OR ClearIf you don’t see any results, expand the time range, for example to Last 7 days.
From the list of Meta fields list in the sidebar, add
_score.Add any other fields you want to the document table.
You're sorting by the
timestampfield.To turn off sorting by the
timestampfield, click the field sorted option, and then click Clear sorting.Open the Pick fields to sort by menu, and then click _score.
Select High-Low.

Your table now sorts documents from most to least relevant.