-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
多路召回融合排序 #23
多路召回融合排序 #23
Conversation
开始门禁检查,等门禁检查通过后可以合入 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改
/** | ||
* ES search start | ||
*/ | ||
public static final int ES_START = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Es检索下标从0开始
/** | ||
* 按时间排序 | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
统一修改成英文注释
GSearchStrategy gRecall = new GSearchStrategy(gProperties, httpConnectFactory); | ||
MultiSearchContext multirecall = new MultiSearchContext(); | ||
//set es search into search contex | ||
multirecall.setSearchStrategy(esRecall); | ||
multirecall.setSearchStrategy(gRecall); | ||
//do recall and fetch the result | ||
DataComposite multiRecallRes = multirecall.executeMultiSearch(condition); | ||
if ("desc".equals(condition.getSort())) { | ||
return multiRecallRes.getChild(0).getResList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意下标
int year = Integer.parseInt(parts[0]); | ||
int month = Integer.parseInt(parts[1]); | ||
int day = Integer.parseInt(parts[2]); | ||
List<Double> dateWeight = fuProperties.getDateWeight(); | ||
score += (year * dateWeight.get(0) + month * dateWeight.get(1) + day * dateWeight.get(2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try catch异常,避免split(-) 出现错误,导致下标越界
int year = Integer.parseInt(parts[0]); | ||
int month = Integer.parseInt(parts[1]); | ||
int day = Integer.parseInt(parts[2]); | ||
List<Double> dateWeight = fuProperties.getDateWeight(); | ||
score += (year * dateWeight.get(0) + month * dateWeight.get(1) + day * dateWeight.get(2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
出错后设置默认分数
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改
@@ -94,6 +95,9 @@ public Component search(SearchCondition condition) { | |||
* @throws IOException | |||
*/ | |||
private Component searchByCondition(SearchCondition condition) throws ServiceImplException, IOException { | |||
if (!"".equals(condition.getType())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
添加注释
开始门禁检查,等门禁检查通过后可以合入 |
@@ -211,6 +212,9 @@ public void reCaculateScore(Map<String, Object> entity) { | |||
score += (year * dateWeight.get(0) + month * dateWeight.get(1) + day * dateWeight.get(2)); | |||
entity.put("score", score); | |||
} | |||
} catch (Exception e) { | |||
LOGGER.error("es recall score caculate error: {}", e.getMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
服务器中不打印具体错误信息
6d89374
to
9ef5ee4
Compare
开始门禁检查,等门禁检查通过后可以合入 |
No description provided.