Quick fix for string based searches, attempting to convert doc type if they differ.

This commit is contained in:
mike12345567 2022-07-11 12:54:45 +01:00
parent 912561199b
commit 2ae262a080
1 changed files with 4 additions and 1 deletions

View File

@ -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
}