次のデータセットをインデックス「testfilter」に挿入しました
POST /_bulk
{"index":{"_index":"testfilter"}}
{ "jobid": 1, "table_name": "table_A", "Tags": [ { "TagType": "WorkTypeA", "Tag": "ETL" }, { "TagType": "Subject Area", "Tag": "Telecom" } ] }
{"index":{"_index":"testfilter"}}
{ "jobid": 2, "table_name": "table_B", "Tags": [ { "TagType": "WorkTypeB", "Tag": "Engineering" }, { "TagType": "Subject Area", "Tag": "Telecom" } ] }
{"index":{"_index":"testfilter"}}
{ "jobid": 3, "table_name": "table_C", "Tags": [ { "TagType": "WorkTypeC", "Tag": "Development" }, { "TagType": "Subject Area", "Tag": "Telecom" } ] }
インデックス マッピング ( GET testfilter/_mapping ) は次のとおりです。
{
"testfilter" : {
"mappings" : {
"properties" : {
"Tags" : {
"properties" : {
"Tag" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"TagType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"jobid" : {
"type" : "long"
},
"table_name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
X軸を次のように選択して、Kibanaで棒グラフの視覚化を作成すると:
Aggregation : Terms
Filed : Tags.Tag.keyword
グラフが正しく作成されます。Tag : Developmentを選択してフィルタリングすると、「Development」と「Telecom」をフィルタリングする2 つのバーが表示されます (スクリーンショットを参照)。
タグでフィルターをかけたときに、そのタグ データのみを取得するグラフを作成するにはどうすればよいですか?