elasticsearch フィールドについて

pathフィールドについて、グラフ化した時に単語が分割して表示される
elasticsearchがデフォルトでフィールドを分割するようにしているため
分割しないようにして、完全一致と部分一致を可能にするためpathフィールドの型をmulti_fieldにしてみる
root@hostname:/home/shimizu# curl -XGET http://localhost:9200/logstash-2015.07.07/_mapping | jq '.'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 359 100 359 0 0 51103 0 --:--:-- --:--:-- --:--:-- 59833
{
"logstash-2015.07.07": {
"mappings": {
"via_fluentd": {
"properties": {
"@timestamp": {
"type": "date",
"format": "dateOptionalTime"
},
"agent": {
"type": "string"
},
"code": {
"type": "string"
},
"host": {
"type": "string"
},
"method": {
"type": "string"
},
"path": {
"type": "string"
},
"referer": {
"type": "string"
},
"remote": {
"type": "string"
},
"size": {
"type": "string"
},
"user": {
"type": "string"
}
}
}
}
}
}
root@hostname:/home/shimizu# cat multi_field_template.json
{
"template": "logstash-*",
"mappings": {
"_default_": {
"_source": { "compress": true },
"properties" : {
"path" : {
"type": "multi_field",
"fields": {
"path": {
"type": "string",
"index" : "analyzed"
},
"full": {
"type": "string",
"index" : "not_analyzed"
}
}
}
}
}
}
}
root@hostname:/home/shimizu# curl -X PUT http://localhost:9200/_template/log_template -d "`cat multi_field_template.json`"
{"acknowledged":true}
@todo 結果の記載
参考URL
Kibana+Elasticsearchで文字列の完全一致と部分一致検索の両方を実現する
http://qiita.com/harukasan/items/4ec517d8d96f557367e1