Commit 34af005f by wenshuaiying

增加日志

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