Merge pull request #2022 from Budibase/fix/equal-search
Lucene equality searching fix
This commit is contained in:
commit
c55ad5670d
|
@ -148,12 +148,20 @@ class QueryBuilder {
|
|||
}
|
||||
if (this.query.equal) {
|
||||
build(this.query.equal, (key, value) => {
|
||||
return value ? `${key}:${luceneEscape(value.toLowerCase())}` : null
|
||||
const escapedValue = luceneEscape(value.toLowerCase())
|
||||
// have to do the or to manage straight values, or strings
|
||||
return value
|
||||
? `(${key}:${escapedValue} OR ${key}:"${escapedValue}")`
|
||||
: null
|
||||
})
|
||||
}
|
||||
if (this.query.notEqual) {
|
||||
build(this.query.notEqual, (key, value) => {
|
||||
return value ? `!${key}:${luceneEscape(value.toLowerCase())}` : null
|
||||
const escapedValue = luceneEscape(value.toLowerCase())
|
||||
// have to do the or to manage straight values, or strings
|
||||
return value
|
||||
? `(!${key}:${escapedValue} OR !${key}:"${escapedValue}")`
|
||||
: null
|
||||
})
|
||||
}
|
||||
if (this.query.empty) {
|
||||
|
|
Loading…
Reference in New Issue