新增:
POST /test_index/_doc
{
"doc": {
"name":"aaa",
"price": 100009.00,
"desc":"very good"
}
}
修改:
POST /{indexName}/_update/{id}
{
"doc": {
"fieldName" : "fieldValue"
}
}
举例:
POST /test_index/_update/AVYrxH8BeM2aFHTN9y9g
{
"doc": {
"name" : "test_index1_shanghai"
}
}
这种格式已经不再适用,会报错:
POST /{indexName}/_doc/{id}/_update
或者
POST /indexName/{id}/_update
返回错误信息
{
"error" : "no handler found for uri [/test_index/_doc/AVYrxH8BeM2aFHTN9y9g/_update?pretty=true] and method [POST]"
}
查询:
条件查询:
GET /test_index/_search
{
"query": {
"match" : {
"_id" : "AVYrxH8BeM2aFHTN9y9g"
}
}
}
查询所有,和以前版本保持一致
GET /{indexName}/_search
{
"query": {
"match_all": {}
}
}
举例:
GET /test_index/_search
{
"query": {
"match_all": {}
}
}
草稿,内容正在逐渐完善。高手勿喷。。高手勿喷。。