Browse Source

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

Fix indexing of rows with attachments
pull/4023/head
Andrew Kingston 5 years ago
committed by GitHub
parent
commit
2e2b27264d
  1. 10
      packages/server/src/db/views/staticViews.js

10
packages/server/src/db/views/staticViews.js

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

Loading…
Cancel
Save