Quick fix for string based searches, attempting to convert doc type if they differ.
This commit is contained in:
parent
912561199b
commit
2ae262a080
|
@ -170,7 +170,10 @@ export const runLuceneQuery = (docs, query) => {
|
||||||
const filters = Object.entries(query[type] || {})
|
const filters = Object.entries(query[type] || {})
|
||||||
for (let i = 0; i < filters.length; i++) {
|
for (let i = 0; i < filters.length; i++) {
|
||||||
const [key, testValue] = filters[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)) {
|
if (failFn(docValue, testValue)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue