diff --git a/src/services/search/parser.js b/src/services/search/parser.js index da81e9218..d13e1c93d 100644 --- a/src/services/search/parser.js +++ b/src/services/search/parser.js @@ -54,11 +54,15 @@ function getExpression(tokens, parsingContext) { parsingContext.highlightedTokens.push(token.substr(1)); if (i < tokens.length - 2 && isOperator(tokens[i + 1])) { - const operator = tokens[i + 1]; + let operator = tokens[i + 1]; const comparedValue = tokens[i + 2]; parsingContext.highlightedTokens.push(comparedValue); + if (parsingContext.fuzzyAttributeSearch && operator === '=') { + operator = '*=*'; + } + const comparator = comparatorBuilder(operator, comparedValue); if (!comparator) { diff --git a/src/services/search/parsing_context.js b/src/services/search/parsing_context.js index f76ff3b3d..24118050f 100644 --- a/src/services/search/parsing_context.js +++ b/src/services/search/parsing_context.js @@ -4,6 +4,7 @@ class ParsingContext { constructor(includeNoteContent) { this.includeNoteContent = includeNoteContent; this.highlightedTokens = []; + this.fuzzyAttributeSearch = false; this.error = null; }