Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 6ba8ade

Browse files
Revert "topcoder-archive/topcoder-platform-u-bahn-app#295 - Fix issue where special chars in a query would not return results"
This reverts commit e4dc8b8.
1 parent 3b927aa commit 6ba8ade

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/common/es-helper.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,6 @@ function setUserAttributesFiltersToEsQuery (filterClause, attributes) {
584584
}
585585
}],
586586
should: attribute.value.map(val => {
587-
val = val
588-
.replace(/ +/g, ' ')
589-
.split(' ')
590-
.map(word => word.replace(/[^a-zA-Z]/g, c => `${!isRegexReserved(c) ? c : '\\' + c}`))
591-
.join('* AND *')
592-
593587
return {
594588
query_string: {
595589
default_field: `${[USER_ATTRIBUTE.esDocumentValueStringQuery]}`,
@@ -717,7 +711,7 @@ function buildEsQueryFromFilter (filter) {
717711
* @param {*} char the char to check
718712
*/
719713
function isRegexReserved (char) {
720-
const reserved = '+-=&|!(){}[]^"~*?:\\/'
714+
const reserved = '[^$.|?*+(){}\\'
721715
return reserved.indexOf(char) !== -1
722716
}
723717

0 commit comments

Comments
 (0)