一、新建索引
官网API:https://www.elastic.co/guide/cn/elasticsearch/guide/current/_creating_an_index.html
测试用例
代码语言:javascript复制curl -XPUT 'localhost:9200/my_index/my_type/1?pretty' -H 'Content-Type: application/json' -d'
{
"name" : "jiangxingqi",
"sex" : "0",
"introduction" : "My name is jiangxingqi, I am a student of CUEB."
}
'
二、查询
官网API : https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html
测试用例
代码语言:javascript复制curl -XGET 'localhost:9200/my_index/my_type/1?pretty'