1
0
Fork 0
mirror of synced 2024-08-09 07:08:01 +12:00

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

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
}