Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Handling of Quoted Sorting Attributes in YQL sorting Parameter with yqlRepresentation() #33181

Open
yuh701 opened this issue Jan 27, 2025 · 2 comments
Assignees
Milestone

Comments

@yuh701
Copy link

yuh701 commented Jan 27, 2025

Describe the bug

When using the sorting parameter instead of order by in a YQL query such as
select * from hoge where huga;&sorting=-[rank],
specifying a value like [rank] that should be enclosed in quotes results in an error when calling yqlRepresentation().
Ideally, it should generate order by '[rank]' desc,
but it incorrectly generates order by [rank] desc without quotes.

Additional context

This issue occurs when using the sorting parameter in YQL queries. It appears that the handling of special sorting attributes like [rank] does not correctly apply quotes when generating the YQL representation.

@kkraune
Copy link
Member

kkraune commented Jan 28, 2025

@yuh701
Copy link
Author

yuh701 commented Jan 28, 2025

Thank you for your response. I have read the page you provided.
Additionally, I came across this issue: #26397. While it seems related, the situation I am facing is slightly different.

What I am trying to achieve is to use the sorting parameter with [relevance], without using order by. For example:

yql=select id,title from doc where userQuery()&query=sars&sorting=-[relevance]

This request works fine for searching purposes. However, when I attempt to convert it to YQL using yqlRepresentation(), it results in an error.
https://github.com/vespa-engine/vespa/blob/master/container-search/src/main/java/com/yahoo/search/Query.java#L720.

@geirst geirst added this to the soon milestone Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

4 participants