curl -X POST -d @mapping.json + mapping not created

后端 未结 3 1176
滥情空心
滥情空心 2021-02-20 15:43

I am learning elasticsearch. I have specified the mapping in \'mapping.json\'. Its contents are

{
    \"book\" : {
         \"_index\" : {
             \"enabled         


        
相关标签:
3条回答
  • 2021-02-20 16:14

    Please try this,

    curl -XPUT 'http://localhost:9200/<indexname>/book/_mapping' -d @mapping.json
    
    0 讨论(0)
  • 2021-02-20 16:18

    command

    curl -XPUT localhost:9200/_template/logstash -d @/Users/template.json   
    

    response

    {"acknowledged":true}
    
    0 讨论(0)
  • 2021-02-20 16:23

    On AWS I got an error like

    {"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
    

    To fix it I added

    -H 'Content-Type: application/json'
    
    0 讨论(0)
提交回复
热议问题