|
@@ -38,10 +38,11 @@ import java.util.stream.Collectors;
|
|
|
@RequiredArgsConstructor(onConstructor_ = {@Lazy})
|
|
|
public class EsCountService {
|
|
|
private final List<String> childList = Arrays.asList("field");
|
|
|
- private final List<String> nestedList = Arrays.asList("PA", "IN", "PE", "SAT", "MAT", "SRH", "MRH", "MIN","PRCO");
|
|
|
+ private final List<String> nestedList = Arrays.asList("PA", "IN", "PE", "SAT", "SRH","PRCO");
|
|
|
private final List<String> dateList = Arrays.asList("PD", "AD", "GD");
|
|
|
private final List<String> numberList = Arrays.asList("QPN", "QDPN", "SFN", "IFN", "PFN");
|
|
|
private final List<String> nestDateList = Arrays.asList("PRD");
|
|
|
+ private final List<String> nestChildList = Arrays.asList("MAT","MRH","MIN");
|
|
|
|
|
|
|
|
|
private final ElasticsearchClient client;
|
|
@@ -244,6 +245,15 @@ public class EsCountService {
|
|
|
this.getDateAnalysisDTOS(termsAgg, field, topN, detailDTOS, esCountDTO, firstName, map, values);
|
|
|
});
|
|
|
}
|
|
|
+ } else if (nestChildList.contains(field)) {
|
|
|
+ filtersBuckets.forEach(filtersBucket -> {
|
|
|
+ Aggregate filtersAgg = filtersBucket.aggregations().get("filters_agg");
|
|
|
+ Aggregate childAgg = filtersAgg.children().aggregations().get("childAgg");
|
|
|
+ this.getNestedCountDTOS(childAgg, field, topN, detailDTOS, esCountDTO, firstName, map, values);
|
|
|
+ if (!CollectionUtils.isEmpty(values)) {
|
|
|
+ esCountDTO.setAllNumber(childAgg.nested().docCount());
|
|
|
+ }
|
|
|
+ });
|
|
|
} else if (childList.contains(field)) {
|
|
|
if (CollectionUtils.isEmpty(values)) {
|
|
|
Integer finalFieldType = fieldType;
|
|
@@ -289,6 +299,15 @@ public class EsCountService {
|
|
|
if (!CollectionUtils.isEmpty(values)) {
|
|
|
esCountDTO.setAllNumber(agg.nested().docCount());
|
|
|
}
|
|
|
+ } else if (nestDateList.contains(field)) {
|
|
|
+ Aggregate termsAgg = agg.nested().aggregations().get("terms_agg");
|
|
|
+ this.getDateCountDTOS(termsAgg, field, topN, format, detailDTOS, esCountDTO);
|
|
|
+ } else if (nestChildList.contains(field)) {
|
|
|
+ Aggregate childAgg = agg.children().aggregations().get("childAgg");
|
|
|
+ this.getNestedCountDTOS(childAgg, field, topN, detailDTOS, esCountDTO, firstName, map, values);
|
|
|
+ if (!CollectionUtils.isEmpty(values)) {
|
|
|
+ esCountDTO.setAllNumber(childAgg.nested().docCount());
|
|
|
+ }
|
|
|
} else if (childList.contains(field)) {
|
|
|
if (CollectionUtils.isEmpty(values)) {
|
|
|
this.getChildCountDTOS(agg, field, fieldType, topN, detailDTOS, esCountDTO);
|