use pb.filter in the search normalization

This commit is contained in:
Gani Georgiev committed 2026-08-13 14:58:06 +03:00
1 parent d744647929
commit 82368a6152
7 files changed
+12 -10

No files matched your search

+5 -3
View File
@@ -1118,7 +1118,7 @@ const utils = {
return searchTerm;
}
const opChars = ["=", "!=", "~", "!~", ">", ">=", "<", "<="];
const opChars = ["=", "~", ">", "<"];
// loosely check if it is already a filter expression
for (const op of opChars) {
@@ -1128,10 +1128,12 @@ const utils = {
}
searchTerm = isNaN(searchTerm) && searchTerm != "true" && searchTerm != "false"
? `"${searchTerm.replace(/^[\"\'\`]|[\"\'\`]$/gm, "")}"`
? searchTerm.replace(/^[\"\'\`]|[\"\'\`]$/gm, "")
: searchTerm;
return fallbackFields.map((f) => `${f}~${searchTerm}`).join("||");
return fallbackFields.map((f) => {
return app.pb.filter(`${f}?~{:searchTerm}`, { searchTerm });
}).join("||");
},
logLevels: {