PUT my_type_index
{
"mappings": {
"properties": {
"price":{
"type":"float"
}
}
}
}
PUT my_type_index/_doc/1
{
"price":7.8
}
PUT my_type_index/_doc/2
{
"price":"9.4"
}
PUT my_type_index/_doc/3
{
"price":"change the data type"
}
GET my_type_index/_search
{
"query": {
"match_all": {}
}
}
DELETE my_type_index
PUT my_type_index
{
"mappings": {
"properties": {
"price": {
"type": "float",
"coerce": false
}
}
}
}
PUT my_type_index/_doc/1
{
"price":"9.4"
}
DELETE my_type_index2
PUT my_type_index2
{
"mappings": {
"properties": {
"price":{
"type":"float",
"coerce": false
}
}
}
}
POST _reindex
{
"source": {
"index": "my_type_index"
},
"dest": {
"index": "my_type_index2"
}
}
PUT _ingest/pipeline/my_convert_test_pipe
{
"description": "convert string to float",
"processors": [
{
"convert": {
"field": "price",
"type": "float"
}
}
]
}
POST _reindex
{
"source": {
"index": "my_type_index"
},
"dest": {
"index": "my_type_index2",
"pipeline": "my_convert_test_pipe"
}
}
GET my_type_index2/_search
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。