#建立索引
PUT /es_note_tel
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"products": {
"properties": {
"productName": {
"type": "text"
},
"size": {
"type": "keyword"
}
}
}
}
}
#删除索引
DELETE /es_note_tel
#将数据导入es
POST /es_note_tel/products/_bulk
{"index":{}}
{"productName":"Latest art shirts for women in 2017 autumn","size":"L"}
#测试
GET /?pretty
#往索引中添加数据
PUT /es_note_tel/note_tel/1
{
"id":"asdf"
}
#查询文档
GET es_note_tel/note_tel/1
#简单搜索(搜索所有)
GET es_note_tel/note_tel/_search