Commit 8d8f4a0e by 陈健智

舆情分析趋势图No title过滤

parent a601c50c
...@@ -1098,7 +1098,13 @@ public class MarkDataServiceImpl implements MarkDataService { ...@@ -1098,7 +1098,13 @@ public class MarkDataServiceImpl implements MarkDataService {
if (0 == hits.getTotalHits().value) { if (0 == hits.getTotalHits().value) {
return new BaseMap(); return new BaseMap();
} }
return Tools.getBaseFromEsMap(hits.getAt(0).getSourceAsMap()); JSONObject jsonObject = new JSONObject(hits.getAt(0).getSourceAsMap());
BaseMap baseMap = Tools.getBaseFromEsMap(jsonObject);
if (StringUtils.isBlank(baseMap.getContent()) && Objects.nonNull(jsonObject.getString("ocr_text")) && !jsonObject.getJSONArray("ocr_text").isEmpty()){
List<String> ocrText = jsonObject.getJSONArray("ocr_text").toJavaList(String.class);
baseMap.setContent(ocrText.get(0));
}
return baseMap;
} }
@Override @Override
......
...@@ -80,7 +80,7 @@ public class Tools { ...@@ -80,7 +80,7 @@ public class Tools {
/** /**
* 须过滤的标题 * 须过滤的标题
*/ */
public static final List<String> FILTER_TITLE = Arrays.asList("Notitle", "分享一篇文章", "分享一篇文章。", "暂无标题", ""); public static final List<String> FILTER_TITLE = Arrays.asList("Notitle", "分享一篇文章", "分享一篇文章。", "暂无标题", "", "No title");
/** /**
* 须过滤的渠道 * 须过滤的渠道
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment