返回

提问 添加收藏

ElasticSearch返回json失败的问题?

本页包含1张图片,默认未加载,显示所有图片

哎码 发布于 2018年01月13日 (共有0个回帖)

点击加载图片

如图,查询到multiSearchResponse结果之后返回json失败,请问该怎么解决呢?错误如下:

2018-01-13 17:44:27.041 WARN 49204 --- [nio-8080-exec-2] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.http.converter.HttpMessageNotWritableException: Could not write content: No serializer found for class org.elasticsearch.common.text.Text and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.elasticsearch.action.search.MultiSearchResponse["responses"]->org.elasticsearch.action.search.MultiSearchResponse$Item["response"]->org.elasticsearch.action.search.SearchResponse["hits"]->org.elasticsearch.search.SearchHits["hits"]->org.elasticsearch.search.SearchHit["highlightFields"]->java.util.Collections$SingletonMap["attachment.content"]->org.elasticsearch.search.fetch.subphase.highlight.HighlightField["fragments"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.elasticsearch.common.text.Text and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.elasticsearch.action.search.MultiSearchResponse["responses"]->org.elasticsearch.action.search.MultiSearchResponse$Item["response"]->org.elasticsearch.action.search.SearchResponse["hits"]->org.elasticsearch.search.SearchHits["hits"]->org.elasticsearch.search.SearchHit["highlightFields"]->java.util.Collections$SingletonMap["attachment.content"]->org.elasticsearch.search.fetch.subphase.highlight.HighlightField["fragments"])

 

文明上网,理性发言
客户端 Android iPhone WP7