[WIP] PARAM_MAX_ROWS_FOR_FACET_GENERATION

This commit is contained in:
Robert von Burg 2022-02-25 09:01:44 +01:00
parent 9048f394a7
commit aa71a9efbe
2 changed files with 8 additions and 3 deletions

View File

@ -20,7 +20,7 @@ public class ReportConstants {
public static final String PARAM_FIELD_REF2 = "fieldRef2";
public static final String PARAM_ALLOW_MISSING_COLUMNS = "allowMissingColumns";
public static final String PARAM_FILTER_MISSING_VALUES_AS_TRUE = "filterMissingValuesAsTrue";
public static final String PARAM_TRIM_FACETS_VALUES = "trimFacetValues";
public static final String PARAM_MAX_ROWS_FOR_FACET_GENERATION = "maxRowsForFacetGeneration";
public static final String PARAM_POLICY = "policy";
public static final String PARAM_JOIN_PARAM = "joinParam";

View File

@ -540,7 +540,8 @@ public class GenericReport extends ReportPolicy {
.sorted(comparing(StringParameter::getIndex)) //
.map(StringParameter::getUom).collect(toList());
boolean trimFacetValues = this.reportRes.getBoolean(PARAM_TRIM_FACETS_VALUES);
boolean maxRowsForFacetGeneration = this.reportRes.getBoolean(PARAM_MAX_ROWS_FOR_FACET_GENERATION);
long count = 0;
while (iter.hasNext()) {
Map<String, StrolchRootElement> row = iter.next();
@ -554,7 +555,11 @@ public class GenericReport extends ReportPolicy {
}
// stop if we have enough data
if (trimFacetValues && result.stream().mapToInt(e -> e.getValue().size()).allMatch(v -> v >= limit))
count++;
// if (trimFacetValues) {
//
// }
if (result.stream().mapToInt(e -> e.getValue().size()).allMatch(v -> v >= limit))
break;
}