Skip to content

Commit 1c8da34

Browse files
committed
remove scoring caveat no longer true in 9.x
1 parent 30d0e9f commit 1c8da34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ POST /_query?format=txt
223223
OR match(description, "vegetarian curry")
224224
OR match(tags, "vegetarian curry")
225225
| KEEP title, description, tags, _score # Include relevance score in results
226-
| SORT _score DESC # Including `METADATA _score` doesn't automatically sort your results by relevance, you must explicitly sort when the order of results matters
226+
| SORT _score DESC # You must explicitly sort by `_score` to see relevance-based results
227227
| LIMIT 1000
228228
"""
229229
}
@@ -232,11 +232,11 @@ 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.
235+
When working with relevance scoring in ES|QL, 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-
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.
237+
When you include `METADATA _score`, only search functions contribute to the relevance score. Filtering operations (like range conditions and exact matches) don't affect the score.
238238

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.
239+
Remember that including `METADATA _score` doesn't automatically sort your results by relevance. You must explicitly use `SORT _score DESC` or `SORT _score ASC` to order your results by relevance.
240240
:::
241241

242242
## Step 5: Filter and find exact matches

0 commit comments

Comments
 (0)