索引(index)
- 列出所有的索引
curl 'localhost:9200/_cat/indices?v'
- 创建索引
curl -XPUT 'localhost:9200/testabc?pretty'
映射(mapping)
- 添加映射
curl -X PUT "localhost:9200/testabc/article/_mapping" -H 'Content-Type: application/json' -d'
{
"properties":{
"data":{
"type":"text",
}
}
}'
- 查看映射
curl -XGET 'localhost:9200/testabc/_mapping?pretty'
- 添加文档
curl -X PUT "localhost:9200/testabc/article/1" -H 'Content-Type: application/json' -d'
{
"data":"这里是中国"
}'