1. 往 elasticsearch 写入数据调用 index 方法,执行报错:
代码语言:javascript复制Unable to identify index name. XXXModel is not a Document.
Make sure the document class is annotated with @Document(indexName="foo")
2. 原因:XXXModel 实体类上少注解, 加上此注解就可:
代码语言:javascript复制@Document(indexName = "cxx_es", type = "cxx_es")