Browse Source

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

master
mike12345567 4 years ago
parent
commit
e1fab46daf
  1. 5
      packages/frontend-core/src/utils/lucene.js

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

Loading…
Cancel
Save