elasticsearch Elasticsearch字符串数组被标记化,即使在映射中没有分析_,elasticsearch,lucene,elasticui,elasticsearch,Lucene,Elasticui" /> elasticsearch Elasticsearch字符串数组被标记化,即使在映射中没有分析_,elasticsearch,lucene,elasticui,elasticsearch,Lucene,Elasticui" />

elasticsearch Elasticsearch字符串数组被标记化,即使在映射中没有分析_

elasticsearch Elasticsearch字符串数组被标记化,即使在映射中没有分析_,elasticsearch,lucene,elasticui,elasticsearch,Lucene,Elasticui,这让我快发疯了。我的数据中有一些数组,下面是一个精简版: { "fullName": "Jane Doe", "comments": [], "tags": [ "blah blah tag 1", "blah blah tag 1" ], "contactInformation": { "attachments": [ "some file 1", "some file 2", "some file 3" ] }

这让我快发疯了。我的数据中有一些数组,下面是一个精简版:

{
"fullName": "Jane Doe",
"comments": [],
"tags": [
    "blah blah tag 1",
    "blah blah tag 1"
],
"contactInformation": {
    "attachments": [
        "some file 1",
        "some file 2",
        "some file 3"
    ]
}
}
我在elasticsearch中的映射如下:

curl -XPOST localhost:9200/myindex -d '{
"settings" : {
    "number_of_shards" : 1
},
"mappings" : {
    "docs" : {
        "properties" : {
            “tags” : { "type" : "string", "index" : "not_analyzed" }
            “attachments” : { "type" : "string", "index" : "not_analyzed" }
        }
    }
}
}'
现在,如果我将这些显示为面,则标记看起来很好,如下所示:

[]-诸如此类的标签1

[]-诸如此类的标签2

然而,附件是标记化的,每个单词都有一个方面,即

[]-一些

[]-文件

[]-1

我在想,既然attachments属性位于contactInformation中,我的映射可能需要如下所示: “contactInformation.attachments”:{“类型”:“字符串”,“索引”:“未分析”}

但这抛出了一个错误,没有预料到点

有什么想法吗

请参阅文档(特别是标题为的部分)

它应该是这样的:

“映射”:{
“文件”:{
“财产”:{
“标记”:{“类型”:“字符串”,“索引”:“未分析”},
“联系人信息”:{
“类型”:“对象”,
“财产”:{
“附件”:{“类型”:“字符串”,“索引”:“未分析”}
}
}
}
}
}