Analyzers 是由一個 Tokenizer 和任意個數的 TokenFilters 組成:
curl -XPUT "http://localhost:9200/yyyy" -H 'Content-Type: application/json' -d'
{
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "ik_smart",
"char_filter": [
"html_strip"
],
"filter": [
"pinyin_filter",
"lowercase",
"stop",
"ngram_1_20"
]
},
"default_search": {
"type": "custom",
"tokenizer": "ik_smart",
"char_filter": [
"html_strip"
]
}
},
"filter": {
"ngram_1_20": {
"type": "ngram",
"min_gram": 1,
"max_gram": 20,
"token_chars": [
"letter",
"digit"
]
},
"pinyin_filter": {
"type": "pinyin",
"keep_original": true,
"keep_joined_full_pinyin": true
}
}
}
}
}'html