Elasticsearch

index illegal_argument_exception

joonsei 2022. 6. 30. 11:59

Elasticsearch 에서 Index 삭제 시, Wildcard 로 요청하면,
--> Wildcard expressions or all indices are not allowed 에러가 발생하면서 삭제가 안됨.

curl -XDELETE "localhost:9200/<indexName*>"
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "Wildcard expressions or all indices are not allowed"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "Wildcard expressions or all indices are not allowed"
  },
  "status" : 400
}

 

Elasticsaearch 의 action.destructive_requires_name 값을 false 로 바꿔줘야함.

curl -XPUT "localhost:9200/_cluster/settings" -H 'Content-Type: application/json' -d '
{
  "transient": {
	"action.destructive_requires_name":false
  }
}
'


curl -XDELETE "localhost:9200/<indexName*>"
{
  "acknowledged": true
}