Commit e9ef3bd3 by xmh

聚合匹配返回值添加personPoolId

1 parent fda29510
...@@ -374,6 +374,7 @@ public class PersonService { ...@@ -374,6 +374,7 @@ public class PersonService {
} }
private List<Person> match0(SearchRequest searchRequest, Boolean agg) throws Exception { private List<Person> match0(SearchRequest searchRequest, Boolean agg) throws Exception {
String poolId = searchRequest.indices()[0];
List<Person> persons = new ArrayList<>(); List<Person> persons = new ArrayList<>();
SearchResponse search = client.search(searchRequest, RequestOptions.DEFAULT); SearchResponse search = client.search(searchRequest, RequestOptions.DEFAULT);
if (agg) { if (agg) {
...@@ -384,7 +385,7 @@ public class PersonService { ...@@ -384,7 +385,7 @@ public class PersonService {
String personId = (String) bucket.getKey(); String personId = (String) bucket.getKey();
Max maxScore = bucket.getAggregations().get("max_score"); Max maxScore = bucket.getAggregations().get("max_score");
double value = maxScore.getValue(); double value = maxScore.getValue();
Person person = new Person().setPersonId(personId).setScore((float) value); Person person = new Person().setPersonId(personId).setScore((float) value).setPersonPoolId(poolId);
persons.add(person); persons.add(person);
} }
} else { } else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!