kibana 创建es索引步骤
1. 创建index
PUT test_user
{
"settings": {
"index": {
"number_of_shards": "3",
"number_of_replicas": "0"
}
}
}
2. 定义mappering
PUT test_user/_doc/_mapping
{
"properties": {
"id": {
"type": "long"
},
"name": {
"type": "keyword"
},
"age": {
"type": "integer"
}
}
}
3. 设置别名
POST _aliases
{
“actions” : [{“add” : {“index” : “索引名” , “alias” : “别名”}}]
}
4 ES SQL查询
POST /_xpack/sql?format=txt
{
"query": "SELECT * FROM library WHERE release_date < '2000-01-01'"
}