Replace all spaces with underscores in column names rather than just the first one

This commit is contained in:
Andrew Kingston 2022-02-14 10:21:31 +00:00
parent 0862c8db84
commit d34e57382e
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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") {