我想在elasticsearch
中创建一个索引,文档的字段为array
。 Elasticsearch给出了错误-'reason': 'No type specified for field <field_name>'
。
我给像-"field_name": {"store": "false"}
。我希望此字段的类型为字符串数组。
但是Elasticsearch不支持Array类型-
https://www.elastic.co/guide/en/elasticsearch/reference/6.4/array.html
最佳答案
错误消息非常清楚:
No type specified for field field_name
您只需要定义数组中包含的数据类型。
"field_name": {
"type": "text", <--- add this
"store": "false"
}
然后您可以索引一个字符串数组
{
"field_name": ["one", "two", "three"]
}
关于python - 如何为 `Array`类型的字段创建映射?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56143621/