①查询所有索引:curl -X GET "http://192.168.1.***:9200/_cat/indices?v"
②查看该索引下的字段映射(所有字段信息):
curl -X GET "http://192.168.1.***:9200/wk_single_receivables/_mapping?pretty"
③查询该索引下的所有数据
curl -X GET "http://192.168.1.***:9200/wk_single_receivables/_search?pretty" -H "Content-Type: application/json" -d '{
"size": 1000,
"query": {
"match_all": {}
}
}'
④指定索引及id查看详情:
curl -X GET "http://192.168.1.***:9200/wk_single_receivables/_doc/8?pretty"
⑤给ES索引添加字段信息:
curl -X PUT "http://192.168.1.***:9200/wk_single_receivables/_mapping/_doc?pretty" -H "Content-Type: application/json" -d '{
"properties": {
"contractType": {
"type": "integer",
"index": true
}
}
}'
⑥根据id更新数据:
curl -X POST "http://192.168.1.***:9200/wk_single_receivables/_doc/6/_update?pretty" -H "Content-Type: application/json" -d '{
"doc": {
"contractType":1
}
}'