Toggle navigation
Toggle navigation
This project
Loading...
Sign in
yoho-search
/
yoho-search-service
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hugufei
9 years ago
Commit
700e49cc291c1dbdef46f2a166b3e6eb3e548ebe
1 parent
d835848e
add error log StandardAggregation
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
service/src/main/java/com/yoho/search/service/AggregationService.java
service/src/main/java/com/yoho/search/service/AggregationService.java
View file @
700e49c
...
...
@@ -8,6 +8,8 @@ import java.util.Map;
import
org.apache.commons.lang.StringUtils
;
import
org.elasticsearch.action.search.SearchType
;
import
org.elasticsearch.search.aggregations.Aggregation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.context.ApplicationEventPublisherAware
;
...
...
@@ -25,6 +27,8 @@ import com.yoho.search.utils.IgnoreSomeException;
@Service
public
class
AggregationService
implements
ApplicationEventPublisherAware
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AggregationService
.
class
);
@Autowired
private
AggregationFactoryService
aggregationFactoryService
;
...
...
@@ -78,6 +82,7 @@ public class AggregationService implements ApplicationEventPublisherAware{
}
return
result
;
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
publisher
.
publishEvent
(
new
SearchEvent
(
EventReportEnum
.
AGGREGATIONSERVICE_GETAGGNAMEANDRESPONSE
.
getEventName
(),
EventReportEnum
.
AGGREGATIONSERVICE_GETAGGNAMEANDRESPONSE
.
getFunctionName
(),
EventReportEnum
.
AGGREGATIONSERVICE_GETAGGNAMEANDRESPONSE
.
getMoudleName
(),
"exception"
,
IgnoreSomeException
.
filterSomeException
(
e
),
null
));
...
...
@@ -107,6 +112,7 @@ public class AggregationService implements ApplicationEventPublisherAware{
Map
<
String
,
Aggregation
>
aggMaps
=
this
.
doSearchForAggregation
(
searchParam
,
paramMap
);
return
aggregation
.
getAggNameAndResponse
(
aggMaps
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
publisher
.
publishEvent
(
new
SearchEvent
(
EventReportEnum
.
AGGREGATIONSERVICE_GETAGGNAMEANDRESPONSEWITHOUTCACHE
.
getEventName
(),
EventReportEnum
.
AGGREGATIONSERVICE_GETAGGNAMEANDRESPONSEWITHOUTCACHE
.
getFunctionName
(),
EventReportEnum
.
AGGREGATIONSERVICE_GETAGGNAMEANDRESPONSEWITHOUTCACHE
.
getMoudleName
(),
"exception"
,
IgnoreSomeException
.
filterSomeException
(
e
),
null
));
...
...
Please
register
or
login
to post a comment