索引结构:
ElasticClientOrIndex elasticClientOrIndex = new ElasticClientOrIndexImp();
RestHighLevelClient client = elasticClientOrIndex.getClient();
TestClass testClass = new TestClass();
testClass.setUserName("mjx");
testClass.setUserName("1");
String s=testClass.toString();
IndexRequest indexRequest = new IndexRequest("test","test1");
indexRequest.source(s, XContentType.JSON);
client.index(indexRequest);最后一行报错如下: ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=failed to parse]
]; nested: ElasticsearchException[Elasticsearch exception [type=not_x_content_exception, reason=not_x_content_exception: Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes]];
at org.elasticsearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:177)
at org.elasticsearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:573)
at org.elasticsearch.client.RestHighLevelClient.parseResponseException(