Elasticsearch 认证模拟题 - 5
# 创建索引
PUT earthquakes
{
"settings": {
"number_of_replicas": 0
},
"mappings": {
"properties": {
"timestamp":{
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss"
},
"magnitude":{
"type": "float"
},
"type":{
"type":"integer"
},
"depth":{
"type":"float"
}
}
}
}
# 导入数据
POST earthquakes/_bulk
{"index":{}}
{"timestamp":"2012-01-01 12:12:12", "magnitude":4.56, "type":1, "depth":10}
{"index":{}}
{"timestamp":"2012-01-01 15:12:12", "magnitude":6.46, "type":2, "depth":11}
{"index":{}}
{"timestamp":"2012-02-02 13:12:12", "magnitude":4, "type":2, "depth":5}
{"index":{}}
{"timestamp":"2012-03-02 13:12:12", "magnitude":6, "type":3, "depth":8}
{"index":{}}
{"timestamp":"1967-03-02 13:12:12", "magnitude":6, "type":2, "depth":6}