Skip to content

Build your personal knowledge base with Trilium Notes

fuzzy search for values as well

zadama06662f4ce6d
diff --git a/src/services/search/parser.js b/src/services/search/parser.js
index da81e92185..d13e1c93dd 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 f76ff3b3d4..24118050f1 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;
}