Commit ca508586 by 翟柏林

修改分数为float以及添加personId筛选条件

1 parent cd6b5cda
...@@ -256,7 +256,7 @@ public class PersonService { ...@@ -256,7 +256,7 @@ public class PersonService {
matchResultSize = Constant.BODY_MATCH_RESULT_SIZE; matchResultSize = Constant.BODY_MATCH_RESULT_SIZE;
} }
Stream<Person> stream = matchResult.stream().sorted(Comparator.comparingInt(Person::getScore).reversed()); Stream<Person> stream = matchResult.stream().sorted(Comparator.comparingDouble(Person::getScore).reversed());
if (matchResult.size() > matchResultSize) { if (matchResult.size() > matchResultSize) {
stream = stream.limit(matchResultSize); stream = stream.limit(matchResultSize);
} }
...@@ -325,6 +325,9 @@ public class PersonService { ...@@ -325,6 +325,9 @@ public class PersonService {
if (channelSerialNums != null && channelSerialNums.size() > 0) { if (channelSerialNums != null && channelSerialNums.size() > 0) {
boolQuery.filter(QueryBuilders.termsQuery("channelSerialNum", channelSerialNums)); boolQuery.filter(QueryBuilders.termsQuery("channelSerialNum", channelSerialNums));
} }
if(person.getPersonUnid() != null && !person.getPersonUnid().equals("")){
boolQuery.filter(QueryBuilders.termQuery("personId", person.getPersonUnid()));
}
// 根据时间过滤 // 根据时间过滤
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("counttime"); RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("counttime");
...@@ -375,7 +378,7 @@ public class PersonService { ...@@ -375,7 +378,7 @@ public class PersonService {
}) })
.orElse(null)); .orElse(null));
p.setScore((int) item.getScore()); p.setScore(item.getScore());
p.setPersonPoolId(item.getIndex()); p.setPersonPoolId(item.getIndex());
persons.add(p); persons.add(p);
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!