curl --request PUT 'http://localhost:9200/logging'
创建成功响应
{"acknowledged":true,"shards_acknowledged":true,"index":"logging"}
curl --request DELETE 'http://localhost:9200/logging'
删除成功响应
{"acknowledged":true}
curl --request PUT 'http://localhost:9200/logging/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"dynamic": true
}'
设置成功响应
{"acknowledged":true}
keyword
类型字段
curl --request PUT 'http://localhost:9200/logging/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"name": {
"type": "keyword"
}
}
}'
成功响应
{"acknowledged":true}
date
类型字段
curl --request PUT 'http://localhost:9200/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"time": {
"type": "date",
"format": "yyyy-MM-dd HH:mm:ss.SSS"
}
}
}'
curl --request PUT 'http://localhost:9200/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"time": {
"type": "date",
"format": "epoch_millis"
}
}
}'
float
类型字段
curl --request PUT 'http://localhost:9200/_mapping' \
--header 'Content-Type: application/json' \
--data-raw '{
"properties": {
"number": {
"type": "float"
}
}
}'