Search for relevanceedit

Sometimes you might be unsure which documents best match your question. Elasticsearch assigns a relevancy, or score to each document, so you can can narrow your search to the documents with the most relevant results. The higher the score, the better it matches your query.

For example, suppose you have the sample flights data set, and you’re a searching for a flight that arrived or departed from Warsaw or Venice when the weather was clear.

  1. In Discover, open the index pattern dropdown, and select kibana_sample_data_flight.
  2. In the query bar, click KQL, and switch to the Lucene query syntax.
  3. Search for Warsaw OR Venice OR Clear.
  4. If you don’t see any results, open the time filter and select a time range that contains data.
  5. From the list of Available fields, add _score to the document table.
  6. In the document table, click the header for the _score column, and then sort the column by descending scores.

    The results are currently sorted by first Time, and then by _score.

  7. To sort only by _score, remove the Time field.

    Your table now shows documents with the best matches, from most to least relevant.

    Example of a search for relevance