1.添加测试数据
PUT /test_index/test_type/1
{
"test_content1":"my field1",
"test_content2":"my field2"
}
2.获取返回结果
GET /test_index/test_type/1
结果
{
"_index": "test_index",
"_type": "test_type",
"_id": "1",
"_version": 2,
"found": true,
"_source": {
"test_content1": "my field1",
"test_content2": "my field2"
}
}
3.通过指定参数返回相应内容 参数可以以逗号分隔
GET /test_index/test_type/1?_source=test_content1
结果
{
"_index": "test_index",
"_type": "test_type",
"_id": "1",
"_version": 2,
"found": true,
"_source": {
"test_content1": "my field1"
}
}
来源:oschina
链接:https://my.oschina.net/u/4456229/blog/3190625