diff --git a/frontend/src/container/Trace/Search/AllTags/Tag/index.tsx b/frontend/src/container/Trace/Search/AllTags/Tag/index.tsx
index a377de487f..f8072ab895 100644
--- a/frontend/src/container/Trace/Search/AllTags/Tag/index.tsx
+++ b/frontend/src/container/Trace/Search/AllTags/Tag/index.tsx
@@ -75,7 +75,7 @@ const SingleTags = (props: AllTagsProps): JSX.Element => {
value={AllMenu.find((e) => e.key === selectedOperator)?.value || ''}
>
{AllMenu.map((e) => (
-
))}
diff --git a/frontend/src/container/Trace/Search/util.ts b/frontend/src/container/Trace/Search/util.ts
index d74a133229..91e235b4a1 100644
--- a/frontend/src/container/Trace/Search/util.ts
+++ b/frontend/src/container/Trace/Search/util.ts
@@ -13,14 +13,14 @@ export const parseQueryToTags = (query: string): PayloadProps => {
const noOfTags = query.split(' AND ');
const tags: Tags = noOfTags.map((filter) => {
- const isInPresent = filter.includes('IN');
- const isNotInPresent = filter.includes('NOT_IN');
+ const isInPresent = filter.includes('in');
+ const isNotInPresent = filter.includes('not in');
- if (!isNotInPresent || !isInPresent) {
+ if (!isNotInPresent && !isInPresent) {
isError = true;
}
- const splitBy = isNotInPresent ? 'NOT_IN' : isInPresent ? 'IN' : '';
+ const splitBy = isNotInPresent ? 'not in' : isInPresent ? 'in' : '';
if (splitBy.length === 0) {
isError = true;
@@ -40,13 +40,15 @@ export const parseQueryToTags = (query: string): PayloadProps => {
const removingFirstAndLastBrackets = `${filterForTags?.slice(1, -1)}`;
- const noofFilters = removingFirstAndLastBrackets.split(',');
+ const noofFilters = removingFirstAndLastBrackets
+ .split(',')
+ .map((e) => e.replaceAll(/"/g, ''));
noofFilters.forEach((e) => {
const firstChar = e.charAt(0);
const lastChar = e.charAt(e.length - 1);
- if (!(firstChar === '"' && lastChar === '"')) {
+ if (firstChar === '"' && lastChar === '"') {
isError = true;
}
});
@@ -73,7 +75,9 @@ export const parseTagsToQuery = (tags: Tags): PayloadProps => {
isError = true;
}
- return `${Key[0]} ${Operator} (${Values.map((e) => `"${e}"`).join(',')})`;
+ return `${Key[0]} ${Operator} (${Values.map((e) => {
+ return `"${e.replaceAll(/"/g, '')}"`;
+ }).join(',')})`;
})
.join(' AND ');