Fix indexing of rows with arrays of objects
This commit is contained in:
parent
c20e5763d8
commit
6e856c4bd7
|
@ -100,11 +100,11 @@ exports.createAllSearchIndex = async appId => {
|
|||
let idxKey = prev != null ? `${prev}.${key}` : key
|
||||
idxKey = idxKey.replace(/ /, "_")
|
||||
if (Array.isArray(input[key])) {
|
||||
for (let val in input[key]) {
|
||||
for (let val of input[key]) {
|
||||
if (typeof val !== "object") {
|
||||
// eslint-disable-next-line no-undef
|
||||
index(idxKey, input[key][val], {
|
||||
store: true,
|
||||
})
|
||||
index(idxKey, val, { store: true })
|
||||
}
|
||||
}
|
||||
} else if (key === "_id" || key === "_rev" || input[key] == null) {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue