arrays - Elasticsearch文档映射类型与存储类型不同

标签 arrays elasticsearch mapping

嗨,我在Elasticsearch 2中有一个索引,其中包含此属性联系人的定义:

...
,
"contacts": {
   "properties": {
        "domains": {
             "type": "string",
              "index": "not_analyzed"
         },
         "emails": {
              "type": "string",
              "index": "not_analyzed"
         },
         "phones": {
              "type": "string",
              "index": "not_analyzed"
         }
    }
},
...

正如我所看到的,此联系人属性索引中的数据包含数组,而不是映射所表示的字符串。这怎么可能?
    "contacts": {
        "domains": [
            "http://www.xxxxx.sk",
            "http://www.sssss.sk",
            "http://ddddd.sk",
            "http://www.ddddd.sk",
            "http://www.wwwww.sk",
            "http://www.ffffffff.sk"
        ],
        "phones": [
            "123456789",
            "987456321",
            "852147963"
        ],
        "emails": [
            "ccc@cccccc.sk",
            "ggggggg@vggggg.sk",
            "qqqqqqq@qqqqq.sk",
            "sssssssss@sssss.sk",
            "nadacia@volkswagen.sk",
            "vvvvvv@vvvvvvv.sk",
        ]
    },

最佳答案

从ES文档中:https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html

In Elasticsearch, there is no dedicated array type. Any field can contain zero or more values by default, however, all values in the array must be of the same datatype.

关于arrays - Elasticsearch文档映射类型与存储类型不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52841063/

相关文章:

elasticsearch - 来自外部文件的Spring Data Elastic命名查询

c - 将初始数字映射到所有字母

elasticsearch - 卡夫卡融合云ElasticsearchSink Connector:索引中的映射冲突

java - spring servlet 映射到 .html 会响应工作,但映射到非 html 结尾 url 不会

jpa - Eclipselink 实体映射缓存

Python PULP 数组乘法约束

c - 用枚举变量定义一个数组作为数组大小

java - 如何将字符串转换为 JSONArray?

c - 从 C 中的文件读取(可变长度)输入

search - 实现搜索 : Identifying known keywords