|
@@ -153,7 +153,6 @@ public class EsCountService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
if (!CollectionUtils.isEmpty(customFields)) {
|
|
|
searchCondition = esService.parseCustomField(customFields);
|
|
|
}
|
|
@@ -478,9 +477,13 @@ public class EsCountService {
|
|
|
EsCountDetailDTO countDTO = new EsCountDetailDTO();
|
|
|
countDTO.setField(field);
|
|
|
countDTO.setName("其他");
|
|
|
- countDTO.setNumber(agg.sterms().sumOtherDocCount());
|
|
|
countDTO.setTopN(topN);
|
|
|
- detailDTOS.add(countDTO);
|
|
|
+ Long count = agg.sterms().sumOtherDocCount();
|
|
|
+ if (count > 0) {
|
|
|
+ countDTO.setNumber(count);
|
|
|
+ detailDTOS.add(countDTO);
|
|
|
+ }
|
|
|
+
|
|
|
List<StringTermsBucket> list = agg.sterms().buckets().array();
|
|
|
list.forEach(bucket -> {
|
|
|
EsCountDetailDTO dto = new EsCountDetailDTO();
|
|
@@ -933,9 +936,13 @@ public class EsCountService {
|
|
|
EsCountDetailDTO countDTO = new EsCountDetailDTO();
|
|
|
countDTO.setField(field);
|
|
|
countDTO.setName("其他");
|
|
|
- countDTO.setNumber(termsAgg.sterms().sumOtherDocCount());
|
|
|
countDTO.setTopN(topN);
|
|
|
- countDetailDTOS.add(countDTO);
|
|
|
+ Long count = termsAgg.sterms().sumOtherDocCount();
|
|
|
+ if (count > 0) {
|
|
|
+ countDTO.setNumber(count);
|
|
|
+ countDetailDTOS.add(countDTO);
|
|
|
+ }
|
|
|
+
|
|
|
List<StringTermsBucket> list = termsAgg.sterms().buckets().array();
|
|
|
list.forEach(bucket -> {
|
|
|
EsCountDetailDTO dto = new EsCountDetailDTO();
|