From e1fab46dafeb1ac1479fa5cc06d295a64f2b6e47 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 11 Jul 2022 12:54:45 +0100 Subject: [PATCH] Quick fix for string based searches, attempting to convert doc type if they differ. --- packages/frontend-core/src/utils/lucene.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/frontend-core/src/utils/lucene.js b/packages/frontend-core/src/utils/lucene.js index 1001ec26a8..d02d6e60a3 100644 --- a/packages/frontend-core/src/utils/lucene.js +++ b/packages/frontend-core/src/utils/lucene.js @@ -170,7 +170,10 @@ export const runLuceneQuery = (docs, query) => { const filters = Object.entries(query[type] || {}) for (let i = 0; i < filters.length; i++) { const [key, testValue] = filters[i] - const docValue = Helpers.deepGet(doc, key) + let docValue = Helpers.deepGet(doc, key) + if (typeof docValue !== "string" && typeof testValue === "string") { + docValue = docValue.toString() + } if (failFn(docValue, testValue)) { return false }