Skip to content

Commit 22b1ad1

Browse files
committed
Clarify note about scoring
1 parent a4c533c commit 22b1ad1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

solutions/search/esql-full-text-filter-tutorial.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,13 @@ POST /_query?format=txt
232232
In this example, we're using the `boost` parameter to make matches in the title field twice as important as matches in other fields. We also request the `_score` metadata field to sort results by relevance.
233233

234234
:::{tip}
235-
When working with relevance scoring in {{esql}}, it's important to understand how `_score` works. If you don't include `METADATA _score` in your query, you're only performing filtering operations with no relevance calculation. When you do include it, only full-text search functions like `match()` or the `:` operator will contribute to the relevance score.
235+
When working with relevance scoring in {{esql}}, it's important to understand how `_score` works. If you don't include `METADATA _score` in your query, you're only performing filtering operations with no relevance calculation.
236236

237-
Currently, filtering operations like range conditions and exact matches still contribute a constant score, which can affect results. This behavior will change in future versions, where these operations won't affect scoring at all.
237+
In current versions, when you include `METADATA _score`, both full-text search functions (like `match()` or the `:` operator) and filtering operations (like range conditions and exact matches) contribute to the relevance score. Full-text search functions provide variable scores based on relevance, while filtering operations add a constant score component.
238+
239+
This behavior will change in future versions, where only full-text search functions will affect scoring, and filtering operations won't contribute to the score at all.
240+
241+
Remember that including `METADATA _score` doesn't automatically sort your results by relevance - you must explicitly use `SORT _score DESC` when the order of results matters.
238242
:::
239243

240244
## Step 5: Filter and find exact matches

0 commit comments

Comments
 (0)