Skip to content

Commit 08ff557

Browse files
authored
[DOCS] Updates search for relevance doc (#101439)
* [DOCS] Updates search for relevance doc * [DOCS] Better explanation of multi-column sorting * [DOCS] Fixes typo
1 parent 0894f67 commit 08ff557

4 files changed

Lines changed: 24 additions & 12 deletions

File tree

50.1 KB
Loading
1.43 KB
Loading
1.27 KB
Loading
Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
[[discover-search-for-relevance]]
22
== Search for relevance
3-
Sometimes you might be unsure which documents best match your question.
3+
Sometimes you might be unsure which documents best match your search.
44
{es} assigns a relevancy, or score to each document, so you can
55
can narrow your search to the documents with the most relevant results.
66
The higher the score, the better it matches your query.
77

8-
For example, suppose you have the <<gs-get-data-into-kibana, sample flights data set>>, and you're a searching for
9-
a flight that arrived or departed from `Warsaw` or `Venice` when the weather was clear.
8+
This example shows how to use *Discover* to list
9+
your documents from most relevant to least relevant. This example uses
10+
the <<gs-get-data-into-kibana, sample flights data set>>, or you can use your own data.
1011

11-
. In *Discover*, open the index pattern dropdown, and select `kibana_sample_data_flight`.
12-
. In the query bar, click *KQL*, and switch to the <<lucene-query, Lucene query syntax>>.
13-
. Search for `Warsaw OR Venice OR Clear`.
14-
. If you don't see any results, open the time filter and select a time range that contains data.
15-
. From the list of *Available fields*, add `_score` to the document table.
16-
. In the document table, click the header for the `_score` column, and then sort the column by descending scores.
12+
. In *Discover*, open the index pattern dropdown, and select that data you want to work with.
1713
+
18-
The results are currently sorted by first `Time`, and then by `_score`.
19-
. To sort only by `_score`, remove the `Time` field.
14+
For the sample flights data, set the index pattern to *kibana_sample_data_flights*.
15+
. In the query bar, click *KQL*, and then turn it off.
2016
+
21-
Your table now shows documents with the best matches, from most to least relevant.
17+
You're now using the <<lucene-query, Lucene query syntax>>.
18+
. Run your search. For the sample data, try:
19+
+
20+
```ts
21+
Warsaw OR Venice OR Clear
22+
```
23+
. If you don't see any results, expand the <<set-time-filter,time range>>, for example to *Last 7 days*.
24+
. From the list of *Available fields*, add `_score` and any other fields you want to the document table.
25+
. To sort the `_score` column in descending order, hover over its header, and then click twice on
26+
the arrow icon
27+
image:images/double-arrow.png[Double arrow icon to indicate sorting] so it changes to
28+
image:images/downward-arrow.png[Downward pointing arrow to indicate descending sorting].
29+
+
30+
At this point, you're doing a multi-column sort: first by `Time`, and then by `_score`.
31+
. To turn off sorting for the `Time` field, hover over its header, and then click the down arrow.
32+
+
33+
Your table now sorts documents from most to least relevant.
2234
+
2335
[role="screenshot"]
2436
image::images/discover-search-for-relevance.png["Example of a search for relevance"]

0 commit comments

Comments
 (0)