1
0
Fork 0
mirror of synced 2024-06-28 02:50:50 +12:00

Has all of internalSearch

This commit is contained in:
Mel O'Hagan 2022-07-26 14:01:45 +01:00
parent 89c4175832
commit 71adcfab3c

View file

@ -171,10 +171,17 @@ class QueryBuilder {
}
const contains = (key, value) => {
if (!value && value !== 0) {
if (!Array.isArray(value) || value.length === 0) {
return null
}
return `${key}:${builder.preprocess(value, { escape: true })}`
let andStatement = `${builder.preprocess(value[0], { escape: true })}`
for (let i = 1; i < value.length; i++) {
andStatement += ` AND ${builder.preprocess(
value[i],
{ escape: true }
)}`
}
return `${key}:(${andStatement})`
}
const oneOf = (key, value) => {