ajanthan commented on a change in pull request #1255: Fixing #1231. Adding order and status to trace query. URL: https://github.com/apache/incubator-skywalking/pull/1255#discussion_r190452456
########## File path: apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/ui/SegmentDurationEsUIDAO.java ########## @@ -73,16 +75,30 @@ public TraceBrief loadTop(long startSecondTimeBucket, long endSecondTimeBucket, boolQueryBuilder.must().add(rangeQueryBuilder); } if (StringUtils.isNotEmpty(operationName)) { - mustQueryList.add(QueryBuilders.matchPhraseQuery(SegmentDurationTable.SERVICE_NAME.getName(), operationName)); + mustQueryList.add(QueryBuilders.matchQuery(SegmentDurationTable.SERVICE_NAME.getName(), operationName)); } if (CollectionUtils.isNotEmpty(segmentIds)) { boolQueryBuilder.must().add(QueryBuilders.termsQuery(SegmentDurationTable.SEGMENT_ID.getName(), segmentIds)); } if (applicationId != 0) { boolQueryBuilder.must().add(QueryBuilders.termQuery(SegmentDurationTable.APPLICATION_ID.getName(), applicationId)); } - - searchRequestBuilder.addSort(SegmentDurationTable.START_TIME.getName(), SortOrder.DESC); + switch (traceState) { + case ERROR: + mustQueryList.add(QueryBuilders.matchQuery(SegmentDurationTable.IS_ERROR.getName(), 1)); + break; + case SUCCESS: + mustQueryList.add(QueryBuilders.matchQuery(SegmentDurationTable.IS_ERROR.getName(), 0)); Review comment: Changed it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services