ElasticSearch的一个坑,发现中文分词的Analyser不起作用,生成的mapping里面完全不包含指定的内容,得到的都是类似这样的结果:

“name”: {
                        “type”: “text”,
                        “fields”: {
                            “keyword”: {
                                “type”: “keyword”,
                                “ignore_above”: 256
                            }
                        }
                    }
其实我期望的是:
“name”: {
                        “type”: “text”,
                        “analyzer”: “ik_smart”
                    }
问题在于这个Entity的class上有些字段没有设置Field,有些设置了但是没有指定类型。这些问题修正后就没有问题了。
(Visited 302 times, 1 visits today)