diff --git a/packages/server/src/api/controllers/row/internalSearch.js b/packages/server/src/api/controllers/row/internalSearch.js index 611b3272f3..ad95a25fc5 100644 --- a/packages/server/src/api/controllers/row/internalSearch.js +++ b/packages/server/src/api/controllers/row/internalSearch.js @@ -235,7 +235,7 @@ class QueryBuilder { if (this.sort) { const order = this.sortOrder === "descending" ? "-" : "" const type = `<${this.sortType}>` - body.sort = `${order}${this.sort.replace(/ /, "_")}${type}` + body.sort = `${order}${this.sort.replace(/ /g, "_")}${type}` } return body } diff --git a/packages/server/src/db/views/staticViews.js b/packages/server/src/db/views/staticViews.js index 50b7c305d3..fa0b1f3605 100644 --- a/packages/server/src/db/views/staticViews.js +++ b/packages/server/src/db/views/staticViews.js @@ -96,7 +96,7 @@ exports.createAllSearchIndex = async () => { function idx(input, prev) { for (let key of Object.keys(input)) { let idxKey = prev != null ? `${prev}.${key}` : key - idxKey = idxKey.replace(/ /, "_") + idxKey = idxKey.replace(/ /g, "_") if (Array.isArray(input[key])) { for (let val of input[key]) { if (typeof val !== "object") {