| standard | 一文字だけ |
| simple | スペース区切り |
| kuromoji | 日本語の形態素解析 |
UserAgentなどの用に空白で区切られた文字列をデフォルトで取り込むと解析されてしまい、ブラウザごとのシェアなどが正しく判定できない。全文一致のみ利用するのであればnot_analyzedを指定する。ただしそれだけだと今後は部分一致ができなくなるので部分一致用の設定も入れてあげる必要がある。Multi-Fieldと呼ばれていたが2.0以降ではやり方が違う。
"mappings": {
"company": {
"_source": {
"enabled": true
},
"_all": {
"enabled": true,
"analyzer": "kuromoji_analyzer"
},
"properties": {
"id": {
"type": "integer",
"index": "not_analyzed"
},
"name": {
"type": "string",
"index": "analyzed",
"analyzer": "ngram_analyzer"
},
"location": {
"type": "string",
"index": "analyzed",
"analyzer": "kuromoji_analyzer"
}
}
},
"project": {
"_source": {
"enabled": true
},
"_all": {
"enabled": true,
"analyzer": "kuromoji_analyzer"
},
"_parent": {
"type": "company"
},
"properties": {
"id": {
"type": "integer",
"index": "not_analyzed"
},
"title": {
"type": "string",
"index": "analyzed",
"analyzer": "kuromoji_analyzer"
}
}
}
}