标签:button url 客户 let ret 自动 cat led elastics
Let’s now put something into our customer index. We’ll index a simple customer document into the customer index, with an ID of 1 as follows:
curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H ‘Content-Type: application/json‘ -d‘
{
"name": "John Doe"
}
‘
{ "_index" : "customer", "_type" : "_doc", "_id" : "1", "_version" : 1, "result" : "created", "_shards" : { "total" : 2, "successful" : 1, "failed" : 0 }, "_seq_no" : 0, "_primary_term" : 1 }
From the above, we can see that a new customer document was successfully created inside the customer index. The document also has an internal id of 1 which we specified at index time.
curl -X GET "localhost:9200/customer/_doc/1?pretty"
And the response:
{ "_index" : "customer", "_type" : "_doc", "_id" : "1", "_version" : 1, "found" : true, "_source" : { "name": "John Doe" } }
Nothing out of the ordinary here other than a field, found
, stating that we found a document with the requested ID 1 and another field, _source
, which returns the full JSON document that we indexed from the previous step.
标签:button url 客户 let ret 自动 cat led elastics
原文地址:https://www.cnblogs.com/shuaiandjun/p/10271921.html