Skip to content

Commit

Permalink
datastore: fix facet 'format:count(size)' to behaviour as 'count(form…
Browse files Browse the repository at this point in the history
…at)', #TASK-7151, #TASK-7134
  • Loading branch information
jtarraga committed Dec 14, 2024
1 parent de98cda commit ac66d66
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,8 @@ private static Facet getMongoDBFacet(String groupField, Accumulator accumulator,
Facet facet;
switch (accumulator) {
case count: {
if (StringUtils.isEmpty(facetName)) {
facetName = groupField + SEPARATOR + COUNTS_SUFFIX;
}
facet = new Facet(facetName, Aggregates.group("$" + groupFieldId, Accumulators.sum(count.name(), 1)));
facetName = groupField + SEPARATOR + COUNTS_SUFFIX;
facet = new Facet(facetName, Aggregates.group("$" + groupField, Accumulators.sum(count.name(), 1)));
break;
}
case sum: {
Expand Down

0 comments on commit ac66d66

Please sign in to comment.