java.lang.IllegalArgumentException: mapping source must be pairs of fieldnames and properties definition.
从es官网找到的
request.mapping("_doc", "{\n" + " \"_doc\": {\n" + " \"properties\": {\n" + " \"message\": {\n" + " \"type\": \"text\"\n" + " }\n" + " }\n" + " }\n" + "}", XContentType.JSON);不生效并报错查看源码,发现mapping的第二个参数,要求必须为 %2==0,改为
request.mapping("_doc", "datetime", "type=date");多个参数
request.mapping("_doc", "datetime", "type=date", "string", "type=text");
原文地址:https://www.cnblogs.com/BigWrite/p/11584752.html
时间: 2024-11-13 04:11:15