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

Handle parentheses search queries #1828

Merged
merged 9 commits into from
Oct 30, 2024
Merged

Handle parentheses search queries #1828

merged 9 commits into from
Oct 30, 2024

Conversation

tedw87
Copy link
Contributor

@tedw87 tedw87 commented Oct 25, 2024

This PR introduces a fix to handle parentheses in the search functionality.
There is an error when query contains parantheses.
ParseError Token <Token:EOF> required, '(' found


📚 Documentation preview 📚: https://plonerestapi--1828.org.readthedocs.build/

@mister-roboto
Copy link

@tedw87 thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

Use correct terminology.

news/1828.bugfix Outdated Show resolved Hide resolved
src/plone/restapi/search/handler.py Outdated Show resolved Hide resolved
tedw87 and others added 2 commits October 25, 2024 13:30
Copy link
Contributor

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

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

LGTM, but this PR needs a technical review. Thank you!

@tedw87
Copy link
Contributor Author

tedw87 commented Oct 25, 2024

Thank you for all suggestions @stevepiercy.
Yes i will ask for a technical review.

Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

Please replace parentheses with a space rather than an empty string. a query like foo(bar) should be sanitized to foo bar to keep the terms separate, not foobar.

I would also like to have a test for this scenario.

news/1828.bugfix Outdated Show resolved Hide resolved
@davisagli
Copy link
Member

@jenkins-plone-org please run jobs

@davisagli davisagli merged commit b9ca1f9 into main Oct 30, 2024
22 of 25 checks passed
@davisagli davisagli deleted the fix-parentheses-query branch October 30, 2024 20:43
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.

4 participants