es查询某个字段类型
可以使用_mapping API来查询某个字段的类型。具体的请求如下:
GET /your_index/_mapping/field/your_field
其中,your_index是你的索引名称,your_field是你要查询的字段名称。执行该请求后,会返回该字段的类型信息。
例如,如果要查询索引名为"my_index"中字段名为"my_field"的类型,可以执行以下请求:
GET /my_index/_mapping/field/my_field
执行该请求后,会返回该字段的类型信息,例如:
{
"my_index": {
"mappings": {
"properties": {
"my_field": {
"full_name": "my_field",
"mapping": {
"my_field": {
"type": "text"
}
}
}
}
}
}
}
从返回结果中可以看到,my_field字段的类型为"text"
原文地址: http://www.cveoy.top/t/topic/izJU 著作权归作者所有。请勿转载和采集!