Authored by wangnan

自动客服 fix

... ... @@ -62,6 +62,15 @@ public class RobotQuestionServiceImpl extends BaseService implements IRobotQuest
//先完全匹配问题字段
SearchParam searchParam = new SearchParam();
int pageSize = StringUtils.isBlank(paramMap.get("viewNum")) ? 5 : Integer.parseInt(paramMap.get("viewNum"));
if (pageSize < 0) {
return new SearchApiResult().setCode(400).setMessage("分页参数错误");
}
if (pageSize > 100) {
pageSize = 100;
}
searchParam.setOffset(0);
searchParam.setSize(pageSize);
MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("question.question_fullMatch", keyword);
searchParam.setSize(1);
searchParam.setQuery(matchQueryBuilder);
... ... @@ -87,13 +96,6 @@ public class RobotQuestionServiceImpl extends BaseService implements IRobotQuest
}
//构造查询参数
searchParam = new SearchParam();
int pageSize = StringUtils.isBlank(paramMap.get("viewNum")) ? 5 : Integer.parseInt(paramMap.get("viewNum"));
if (pageSize < 0) {
return new SearchApiResult().setCode(400).setMessage("分页参数错误");
}
if (pageSize > 100) {
pageSize = 100;
}
searchParam.setOffset(0);
searchParam.setSize(pageSize);
... ...