The requested URL was not found on this server. 不管你信不信,反正我是没找到

elasticsearch-analysis-pinyin 1.7.4 怎么提取首字母

Elasticsearch | 作者 scutfly | 发布于2017年08月16日 | 阅读数:2082

elasticsearch-analysis-pinyin 1.7.4 版本怎么提取首字母?好像只是提供了转化为拼音的功能。(线上跑的2.3.4版本的es,升级怕丢失数据)
 
附索引设置:
{
    "settings":{
        "analysis":{
            "analyzer":{
                "pinyin_analyzer":{
                    "tokenizer":"my_pinyin"
                }
            },
            "tokenizer":{
                "my_pinyin":{
                    "type":"pinyin",
                    "keep_separate_first_letter":true,
                    "keep_full_pinyin":true,
                    "keep_original":true,
                    "limit_first_letter_length":16,
                    "lowercase":true
                }
            }
        }
    },
    "mappings":{
        "user":{
            "properties":{
                "title":{
                    "type":"string",
                    "analyzer":"ik_max_word"
                },
                "user_pinyin_title":{
                    "type":"string",
                    "store":"yes",
                    "term_vector":"with_offsets",
                    "analyzer":"pinyin_analyzer"
                },
                "biography":{
                    "type":"string",
                    "analyzer":"ik_max_word"
                }
            }
        }
    }
}
已邀请:

medcl - 今晚打老虎。

赞同来自:

旧版本没有这个功能,只提供了转换,升级吧。

要回复问题请先登录注册