Found 0 result in total
Content is empty
If you don't find the content you expect, please try another search term
Last updated:2023-07-11 14:20:01
In the Kibana console, create the school index of the student type. The index contains four fields: name, address, age, and date. For more information about the field types, see Field Datatypes.
PUT school
{
"settings":{
"number_of_shards": 3,
"number_of_replicas": 1
},
"mappings":{
"student":{
"properties":{
"name":{
"type":"text"
},
"address":{
"type":"keyword"
},
"age":{
"type":"integer"
},
"date":{
"type":"date",
"format":"yyyy-MM-dd HH:mm:ss"
}
}
}
}
}
If the returned information contains "errors" : false, the data is inserted.
POST /school/student/_bulk
{"index":{}}
{"name":"Zhangsan","address":"Shandong Jinan","age":"22","date":"2020-01-19 08:10:00"}
{"index":{}}
{"name":"Lisi","address":"Beijing Haidian","age":"21","date":"2020-02-19 09:00:00"}
{"index":{}}
{"name":"Wangwu","address":"Jinlin Changchun","age":"23","date":"2020-02-19 10:00:00"}
GET /school/_search
{
"query": {
"match": {
"address": "Beijing Haidian"
}
}
}
Pure Mode