elastic4s
elastic4s copied to clipboard
`indexExists` always returns `true` if index string contains `*`
There seems to be a bug with indexExists and wildcards.
client.execute {
indexExists("asdsadasd")
}.await.result.isExists // false
client.execute {
indexExists("asdsadasd*")
}.await.result.isExists // true
If I try it in Kibana, I get the same result. So, it's standard Elasticsearch behaviour. https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html. Might be a bug though, it seems to me that your expectations are correct.
You can set the allow_no_indices parameter to false to get the required behaviour, something like:
client.execute {
indexExists("asdsadasd*").copy(indicesOptions = Some(IndicesOptionsRequest(allowNoIndices = false)))
}.await.result.isExists