一.simple_pattern分词器 simple_pattern分词器是根据正则表达式进行分词的分词器
#创建映射并定义字段内容分词的正则表达式 #正则表达式表示,如果连续有3个数字在一起,则可以被当作一个单词 PUT myindex-simple_pattern { "settings": { "analysis": { "analyzer": { "my_analyzer": { "tokenizer":"my_tokenizer" } }, "tokenizer": { "my_tokenizer": { "type":"simple_pattern", "pattern":"[0123456789]{3}" } } } } } #对指定内容根据"myindex-simple_pattern"分词器进行分词 POST myindex-simple_pattern/_analyze { "analyzer":"my_analyzer", "text":"fd-123-4567-890-xxd9-689-x987" }可以看到"fd-123-4567-890-xxd9-689-x987"被分成了5关键字,分词之后的结果如下 ["123","456","890","689","987"]
标签:ELK,tokenizer,simple,pattern,analyzer,分词器,my From: https://www.cnblogs.com/menglin2010/p/16614399.html