1、新建索引
{
"settings": {
"index": {
"number_of_shards": "5",
"number_of_replicas": "1", "mappings": { "myType": { "properties": { "content": { "type": "text", "analyzer": "comma" } } } }, "analysis": { "analyzer": { "comma": { "type": "pattern", "pattern": ",", "lowercase": false //保留原来大小写 } } } } }}
2、测试

结果:
{
"tokens": [ { "token": "a", "start_offset": 0, "end_offset": 1, "type": "word", "position": 0 } , { "token": "b", "start_offset": 2, "end_offset": 3, "type": "word", "position": 1 } , { "token": "S", "start_offset": 4, "end_offset": 5, "type": "word", "position": 2 } , { "token": "T_L", "start_offset": 6, "end_offset": 9, "typ
本文介绍了如何在Elasticsearch中实现根据自定义符号进行分词的配置和测试过程。
最低0.47元/天 解锁文章
3848

被折叠的 条评论
为什么被折叠?



