2017-11-29 101 views
9

Eskiden ElasticSearch 5.2 kullanmıştım ve sadece 6.0'a yükseltilmiş.ElasticSearch - Content-Type üstbilgisi [application/x-www-form-urlencoded] desteklenmiyor

ben rehber here aşağıdaki bir indeks şablonu oluşturmak için çalışıyorum, ama hata

var am
Content-Type header [application/x-www-form-urlencoded] is not supported 

Benim sorgu

curl -X PUT localhost:9200/_template/template_1 -d ' 
{ 
    "index_patterns": ["te*", "bar*"], 
    "mappings": { 
    "type1": { 
     "properties": { 
     "host_name": { 
      "type": "keyword" 
     } 
     } 
    } 
    } 
}' 

cevap

22

Bunu düzeltmek eklemek bukle seçenek için ise -H 'Content-Type: application/json'


Bu hata nedeniyle oluşur ElasticSearch 6.0 tanıtılan kontrol içerik tipi olarak Elasticsearch 6.0, Ayrıca vücut için doğru içerik türü sağlamalıdır bir gövde içeren tüm DİNLENME istekleri başlayarak this post

açıklanmıştır.