@@ -268,14 +268,14 @@ function getTotalCount (total) {
268268 return typeof total === 'number' ? total : total . value
269269}
270270
271- function escapeRegex ( str ) {
272- return str
273- . replace ( / [ \* \+ \- = ~ > < \" \? ^ \$ { } \( \) \: \! \/ [ \] \\ \s ] / g, '\\$&' ) // replace single character special characters
274- . replace ( / \| \| / g, '\\||' ) // replace ||
275- . replace ( / \& \& / g, '\\&&' ) // replace &&
276- . replace ( / A N D / g, '\\A\\N\\D' ) // replace AND
277- . replace ( / O R / g, '\\O\\R' ) // replace OR
278- . replace ( / N O T / g, '\\N\\O\\T' ) ; // replace NOT
271+ function escapeRegex ( str ) {
272+ return str
273+ . replace ( / [ \* \+ \- = ~ > < \" \? ^ \$ { } \( \) \: \! \/ [ \] \\ \s ] / g, '\\$&' ) // replace single character special characters
274+ . replace ( / \| \| / g, '\\||' ) // replace ||
275+ . replace ( / \& \& / g, '\\&&' ) // replace &&
276+ . replace ( / A N D / g, '\\A\\N\\D' ) // replace AND
277+ . replace ( / O R / g, '\\O\\R' ) // replace OR
278+ . replace ( / N O T / g, '\\N\\O\\T' ) // replace NOT
279279}
280280
281281async function getOrganizationId ( handle ) {
@@ -583,7 +583,6 @@ function setUserAttributesFiltersToEsQuery (filterClause, attributes) {
583583 attribute . value = [ attribute . value ]
584584 }
585585
586-
587586 filterClause . push ( {
588587 nested : {
589588 path : USER_ATTRIBUTE . esDocumentPath ,
@@ -660,7 +659,7 @@ async function setUserSearchClausesToEsQuery (boolClause, keyword) {
660659 boolClause . should . push ( {
661660 query_string : {
662661 fields : [ 'firstName' , 'lastName' , 'handle' ] ,
663- query : `*${ keyword . replace ( / + / g, ' ' ) . split ( ' ' ) . join ( '* AND *' ) } *`
662+ query : `*${ keyword . replace ( / + / g, ' ' ) . split ( ' ' ) . join ( '* OR *' ) } *`
664663 }
665664 } )
666665
0 commit comments