Commit d0d73a41 by chenyuanjie

流量选品-ES索引自定义分词器

parent e830c5eb
...@@ -50,6 +50,35 @@ class EsUtils(object): ...@@ -50,6 +50,35 @@ class EsUtils(object):
"number_of_shards": "3", "number_of_shards": "3",
"number_of_replicas": "1", "number_of_replicas": "1",
"analysis": { "analysis": {
"filter": {
"en_snowball": {
"type": "snowball",
"language": "English"
},
"en_synonym": {
"type": "synonym_graph",
"synonyms_path": "analysis/synonyms_en.txt",
"updateable": "true"
}
},
"analyzer": {
"en_analyzer": {
"type": "custom",
"tokenizer": "standard",
"filter": [
"lowercase",
"en_snowball"
]
},
"en_search_analyzer": {
"tokenizer": "standard",
"filter": [
"lowercase",
"en_synonym",
"en_snowball"
]
}
},
"normalizer": { "normalizer": {
"lowercase_normalizer": { "lowercase_normalizer": {
"type": "custom", "type": "custom",
...@@ -71,7 +100,8 @@ class EsUtils(object): ...@@ -71,7 +100,8 @@ class EsUtils(object):
}, },
"title": { "title": {
"type": "text", "type": "text",
"analyzer": "standard", "analyzer": "en_analyzer",
"search_analyzer": "en_search_analyzer",
"fields": { "fields": {
"keyword": { "keyword": {
"ignore_above": 32766, "ignore_above": 32766,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment