Merge pull request #2525 from Budibase/fix-indexing-attachments

Fix indexing of rows with attachments
This commit is contained in:
Andrew Kingston 2021-09-02 16:48:28 +01:00 committed by GitHub
commit 361f488d65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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]) {
if (typeof val !== "object") {
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
index(idxKey, input[key][val], { index(idxKey, val, { store: true })
store: true, }
})
} }
} else if (key === "_id" || key === "_rev" || input[key] == null) { } else if (key === "_id" || key === "_rev" || input[key] == null) {
continue continue