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 character escaping for elasticsearch to work correctly #16025
base: main
Are you sure you want to change the base?
Conversation
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
13 failed tests on run #33990 ↗︎
Details:
Service/ServiceIngestion.spec.ts • 1 failed test • cypress-ci-mysql-pr-8843531936-1
Pages/Glossary.spec.ts • 2 failed tests • cypress-ci-mysql-pr-8843531936-1Pages/DataQualityAndProfiler.spec.ts • 1 failed test • cypress-ci-mysql-pr-8843531936-1
Features/IncidentManager.spec.ts • 1 failed test • cypress-ci-mysql-pr-8843531936-1
Features/QueryEntity.spec.ts • 2 failed tests • cypress-ci-mysql-pr-8843531936-1
The first 5 failed specs are shown, see all 9 specs in Cypress Cloud. Review all test suite changes for PR #16025 ↗︎ |
@karanh37 can you review and merge |
@@ -188,7 +188,9 @@ export const customServiceComparator = (a: string, b: string): number => { | |||
export const replacePlus = (fqn: string) => fqn.replaceAll('+', ' '); | |||
|
|||
export const ES_RESERVED_CHARACTERS: Record<string, string> = { | |||
'+': '\\+', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi this is breaking at other places.
The idea behind this method is just to escape special characters.
We should not be encoding characters here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer Glossary Assets page.
Glossary terms with special names are not able to fetch assets because we are encoding here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
The error may occur because when querying the api /api/v1/search/query, the searchValue must be converted using the escapeESReservedCharacters method.
If you are wrong, describe the problem in more detail
'&': '%26', | ||
'#': '%23', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alexandr-Nedomets can we escap the required chars here instead replacing it with encoding?
I have validated that we need to escape this chars instead encoding it. I will merge your PR once you push the changes.
'&': '%26', | |
'#': '%23', | |
'&': '\\&', | |
'#': '\\#', | |
'+': '\\+', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @chirag-madlani
If you fix it like this, the search will not work correctly.
This fix will not fix the problems @karanh37 wrote about.
Head branch was pushed to by a user without write access
Quality Gate passed for 'open-metadata-ui'Issues Measures |
Describe your changes:
Fix character escaping for elasticsearch to work correctly
in more detail in ISSUE-16001
Fixes ISSUE-16001
Type of change: