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