elastic4s
elastic4s copied to clipboard
`getIndex` doesn't support date math in index aliases
We are using date math when doing index rollover tasks and use the following string pattern "<index-{now/w{YYYY-ww}}-0001>". Looks like getIndex doesn't support date math in index names.
val resp = client.execute {
getIndex("<index-{now/w{YYYY-ww}}-0001>")
}.await.result
Throws an exception
com.sksamuel.elastic4s.http.JavaClientExceptionWrapper: java.lang.IllegalArgumentException: Illegal character in path at index 1: /<index-{now/w{YYYY-ww}}-0001>
Index creation via createIndex works though.
I think you need to percent encode your index name: https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#api-date-math-index-names.