Skip to content

Commit

Permalink
In ElasticFacadeImpl fix issue with index name prefixing and unprefix…
Browse files Browse the repository at this point in the history
…ing when the index name is a comma separated list of index names
  • Loading branch information
jonesde committed Feb 27, 2024
1 parent dd78edc commit 1c69844
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,23 @@ class ElasticFacadeImpl implements ElasticFacade {
if (index == null) return null
index = index.trim()
if (index.isEmpty()) return null
return indexPrefix != null && !index.startsWith(indexPrefix) ? indexPrefix.concat(index) : index
// handle comma separated index names
return index.split(",").collect({
it = it.trim()
return indexPrefix != null && !it.startsWith(indexPrefix) ? indexPrefix.concat(it) : it
}).join(",")
// return indexPrefix != null && !index.startsWith(indexPrefix) ? indexPrefix.concat(index) : index
}
String unprefixIndexName(String index) {
if (index == null) return null
index = index.trim()
if (index.isEmpty()) return null
return indexPrefix != null && index.startsWith(indexPrefix) ? index.substring(indexPrefix.length()) : index
// handle comma separated index names
return index.split(",").collect({
it = it.trim()
return indexPrefix != null && it.startsWith(indexPrefix) ? it.substring(indexPrefix.length()) : it
}).join(",")
// return indexPrefix != null && index.startsWith(indexPrefix) ? index.substring(indexPrefix.length()) : index
}
}

Expand Down

0 comments on commit 1c69844

Please sign in to comment.