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

fix(api-elasticsearch): contains query with slash #3515

Merged
merged 5 commits into from Sep 14, 2023

Conversation

brunozoric
Copy link
Contributor

@brunozoric brunozoric commented Sep 12, 2023

Changes

When using the contains query, which contained slash (/) in the search term, Elasticsearch failed with a parsing error because of wrong slash escaping in the built query.
Example:
article w/ author
would produce:
*article w\\\\/ author*
but it should have produced:
*article w\\\/ author*

Also, when w/ is at the start or the end of the search term, it would produce a parsing error.
For those two cases, the asterisk (*) is not prepended or appended to the search term, depending on the position of the slash:
article w/ will produce *article w/
w/ articlewill produce /w article*

How Has This Been Tested?

Jest.

@brunozoric brunozoric changed the base branch from next to dev September 12, 2023 08:02
@brunozoric brunozoric self-assigned this Sep 12, 2023
@brunozoric brunozoric added this to the 5.37.4 milestone Sep 12, 2023
@brunozoric brunozoric marked this pull request as ready for review September 12, 2023 08:05
@brunozoric
Copy link
Contributor Author

/cypress

@github-actions
Copy link

Cypress E2E tests have been initiated (for more information, click here). ✨

@brunozoric brunozoric merged commit ec99365 into dev Sep 14, 2023
56 checks passed
@brunozoric brunozoric deleted the bruno/fix/elasticsearch-slash-search branch October 10, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants