PUT /index_sample
{
"settings": {
"analysis" : {
"analyzer" : {
"my_analyzer" : {
"type" : "custom",
"tokenizer" : "standard",
"filter" : [
"my_asciifolding",
"my_apostrophe",
"cjk_bigram"]
}
},
"filter" : {
"my_asciifolding" : {
"type" : "asciifolding",
"preserve_original" : true
},
"my_apostrophe" :{
"type" : "apostrophe"
}
}
}
},
"mappings" : {
"properties": {
"category_number" : {
"type" : "integer",
"fields" : {
"raw" : {
"type" : "keyword"
}
}
},
"product": {
"type" : "text",
"index" : "true",
"store" : "true",
"analyzer" : "my_analyzer",
"fields" : {
"german_field": {
"type" : "text",
"analyzer": "german"
},
"english_field" : {
"type" : "text",
"analyzer" : "english"
},
"chinese_field" : {
"type" : "text",
"analyzer" : "smartcn"
},
"spanish_field": {
"type" : "text",
"analyzer" : "spanish"
},
"czech_analyer" : {
"type" : "text",
"analyzer" : "czech"
},
"french_field": {
"type" : "text",
"analyzer" : "french"
},
"italian_field" : {
"type" : "text",
"analyzer" : "italian"
},
"dutch_field": {
"type" : "text",
"analyzer" : "dutch"
},
"portuguese_field": {
"type" : "text",
"analyzer" : "portuguese"
}
}
}
}
}
}
最佳答案
如果您想查看索引字段的外观
您可以使用_analyse API(我相信您不想这么做)
或者你可以看看_termvectors
GET /<index_name>/_termvectors/<doc_id>?fields=<filed_name>
关于elasticsearch - Elasticsearch语言分析器-文本分析后返回检索到的字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62638814/