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

Indicate to the user when the query syntax is incorrect #111

Open
arteymix opened this issue Sep 15, 2024 · 7 comments
Open

Indicate to the user when the query syntax is incorrect #111

arteymix opened this issue Sep 15, 2024 · 7 comments
Assignees

Comments

@arteymix
Copy link
Member

The backend behaviour when we encounter such queries is to perform it with Lucene's reserved characters escaped.

It would be good to have some feedback in the endpoints that accept a query parameter that the browser can then display.

@oganm
Copy link
Member

oganm commented Sep 18, 2024

Is there an indicator of incorrect query syntax in the output? Bad filters return 400s but was able to only get 500s related to PavlidisLab/Gemma#1225 when testing for bad queries

@arteymix
Copy link
Member Author

Bad queries are usually escaped, so there's no error surfacing to the user.

For 500, these are bugs.

@oganm
Copy link
Member

oganm commented Sep 18, 2024

Then doing this on Gembrow side will need a specification for what is allowable in the query. Where would that be?

@arteymix
Copy link
Member Author

I'm thinking of adding some warnings in the payload that GemBrow can then parse.

data: [...]
query: '"test'
warnings: 
  - message: 'Invalid query syntax: quote is not closed, query was parsed as \"test.'
    for: query

I think it can be generalized whenever we notice something wrong with the request, but not bad enough to produce an HTTP error.

@oganm
Copy link
Member

oganm commented Sep 19, 2024

Of note currently query being " " results in a 400. If all other invalid queries will return a warning, this might join those too

@arteymix
Copy link
Member Author

Yay! It's done! PavlidisLab/Gemma@f3aafa7

@arteymix
Copy link
Member Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants