mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 22:35:50 +01:00
fuzzy search for values as well
This commit is contained in:
@@ -54,11 +54,15 @@ function getExpression(tokens, parsingContext) {
|
|||||||
parsingContext.highlightedTokens.push(token.substr(1));
|
parsingContext.highlightedTokens.push(token.substr(1));
|
||||||
|
|
||||||
if (i < tokens.length - 2 && isOperator(tokens[i + 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];
|
const comparedValue = tokens[i + 2];
|
||||||
|
|
||||||
parsingContext.highlightedTokens.push(comparedValue);
|
parsingContext.highlightedTokens.push(comparedValue);
|
||||||
|
|
||||||
|
if (parsingContext.fuzzyAttributeSearch && operator === '=') {
|
||||||
|
operator = '*=*';
|
||||||
|
}
|
||||||
|
|
||||||
const comparator = comparatorBuilder(operator, comparedValue);
|
const comparator = comparatorBuilder(operator, comparedValue);
|
||||||
|
|
||||||
if (!comparator) {
|
if (!comparator) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class ParsingContext {
|
|||||||
constructor(includeNoteContent) {
|
constructor(includeNoteContent) {
|
||||||
this.includeNoteContent = includeNoteContent;
|
this.includeNoteContent = includeNoteContent;
|
||||||
this.highlightedTokens = [];
|
this.highlightedTokens = [];
|
||||||
|
this.fuzzyAttributeSearch = false;
|
||||||
this.error = null;
|
this.error = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user