Commit 34af005f by wenshuaiying

增加日志

1 parent 9beaf0aa
......@@ -56,8 +56,8 @@ public class ElasticsearchConfiguration {
connectionManager = new PoolingNHttpClientConnectionManager(new
DefaultConnectingIOReactor(ioReactorConfig));
// 设置最大连接数
connectionManager.setMaxTotal(200); // 整个连接池的最大连接数
connectionManager.setDefaultMaxPerRoute(40);
connectionManager.setMaxTotal(properties.getMaxConnTotal()); // 整个连接池的最大连接数
connectionManager.setDefaultMaxPerRoute(properties.getMaxConnPerRoute());
} catch (IOReactorException e) {
throw new RuntimeException(e);
}
......
......@@ -596,6 +596,7 @@ public class PersonService {
List<Person> persons = new ArrayList<>();
// log.info("request:{}", JSON.tojsonS);
try {
log.info("人员匹配查es开始");
SearchResponse<SearchResultHit> search = client.search(searchRequest, SearchResultHit.class);
if (agg) {
Map aggregations = search.aggregations();
......@@ -611,7 +612,7 @@ public class PersonService {
// }
} else {
HitsMetadata hits = search.hits();
// log.info("match0:{}", hits.toString());
log.info("人员匹配, 耗时:{}", search.took());
List<Hit<SearchResultHit>> hits1 = hits.hits();
for (Hit item : hits1) {
SearchResultHit hit = (SearchResultHit) item.source();
......@@ -639,7 +640,7 @@ public class PersonService {
}
}
} catch (Exception e) {
log.error("match0 excepton", e.getMessage());
log.error("match0 excepton", e);
}
return persons;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!