search will also look for type and mime by default

This commit is contained in:
zadam
2020-08-30 23:12:49 +02:00
parent 058edcfe15
commit b793f8cb88
4 changed files with 29 additions and 3 deletions

View File

@@ -36,6 +36,12 @@ class NoteCacheFlatTextExp extends Expression {
const foundAttrTokens = [];
for (const token of tokens) {
if (note.type.includes(token) || note.mime.includes(token)) {
foundAttrTokens.push(token);
}
}
for (const attribute of note.ownedAttributes) {
for (const token of tokens) {
if (attribute.name.toLowerCase().includes(token)
@@ -77,10 +83,18 @@ class NoteCacheFlatTextExp extends Expression {
const foundAttrTokens = [];
for (const token of this.tokens) {
if (note.type.includes(token) || note.mime.includes(token)) {
foundAttrTokens.push(token);
}
}
for (const attribute of note.ownedAttributes) {
const lcName = attribute.name.toLowerCase();
const lcValue = attribute.value.toLowerCase();
for (const token of this.tokens) {
if (attribute.name.toLowerCase().includes(token)
|| attribute.value.toLowerCase().includes(token)) {
if (lcName.includes(token) || lcValue.includes(token)) {
foundAttrTokens.push(token);
}
}