これは私を夢中にさせています。私は自分のデータにいくつかの配列を持っています。これはスリム化されたバージョンです:
{
"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 内にあるため、マッピングは次のようにする必要があるかもしれないと考えていました。
しかし、それはドットを予期せずにエラーをスローしました。
何か案は?