免费注册
帮助文档(华北一、二)
索引一个文档
  • 例,索引为 "inspur",类型为 "information",选择"1"作为ID的编号。这时,请求就是这样的:


    curl -X PUT \  
    http://<host>:9200/inspur/information/1 \ 
    -H 'Content-Type: application/json' \ 
    -d '{     
         "name": "Inspur",     
         "age": 5,     
         "about": "at beijing",     
         "interests": ["service"] 
    }'

    创建成功返回:

    {"_index":"inspur","_type":"information","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":2,"failed":0},"created":true}