Skip to content

Document the YQL labeled() query operator - #4842

Merged
bratseth merged 1 commit into
masterfrom
arnej/add-labeled-yql
Aug 24, 2026
Merged

Document the YQL labeled() query operator#4842
bratseth merged 1 commit into
masterfrom
arnej/add-labeled-yql

Conversation

@arnej27959

Copy link
Copy Markdown
Member

Vespa 8.743.16 adds labeled(subQuery, "label", score), which wraps an arbitrary sub-query in a labeled item carrying a raw score. Until now labels could only be attached with the {label: "..."} annotation, and there was no way to give a sub-query an explicit score for ranking.

Add a reference entry for the operator in the YQL query operator table, next to rank(), explaining that the score is exposed to ranking expressions through itemRawScore(label). The example shows the intended use: retrieve on the main query with rank(), then let labeled() clauses contribute boosts without affecting matching, combined them in a rank profile expression.

Vespa 8.743.16 adds labeled(subQuery, "label", score), which wraps an
arbitrary sub-query in a labeled item carrying a raw score. Until now
labels could only be attached with the {label: "..."} annotation, and
there was no way to give a sub-query an explicit score for ranking.

Add a reference entry for the operator in the YQL query operator
table, next to rank(), explaining that the score is exposed to ranking
expressions through itemRawScore(label). The example shows the intended
use: retrieve on the main query with rank(), then let labeled() clauses
contribute boosts without affecting matching, combined them in a rank
profile expression.
@arnej27959
arnej27959 requested review from bratseth and kkraune August 24, 2026 10:27

@kkraune kkraune left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, and the example is useful!

@bratseth bratseth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

@bratseth
bratseth merged commit 236f31f into master Aug 24, 2026
2 checks passed
@bratseth
bratseth deleted the arnej/add-labeled-yql branch August 24, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants