Paste_Image.png
Create an Index
PUT /customer?pretty
Index and Query a Document
PUT /customer/external/1?pretty
{
"name": "John Doe"
}
http://10.120.198.5:9200/customer/external/1?pretty/
Paste_Image.png
這時你會發(fā)現(xiàn)customer索引中新增了一條document記錄
Paste_Image.png
http://10.120.198.5:9200/customer/external/1?pretty/
查詢需要制定要查詢的縮影customer,索引的類型external拦英,文檔的id pretty作用是json格式化
{
"_index" : "customer",
"_type" : "external",
"_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.
Delete an Index
DELETE /customer?pretty
Paste_Image.png