gsmiller commented on a change in pull request #747: URL: https://github.com/apache/lucene/pull/747#discussion_r828063663
########## File path: lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetCounts.java ########## @@ -190,20 +235,45 @@ private FacetResult getPathResult( String[] parts = FacetsConfig.stringToPath(term.utf8ToString()); labelValues[i] = new LabelAndValue(parts[parts.length - 1], ordAndValue.value); } + return labelValues; + } - if (dimConfig.hierarchical == false) { + /** Returns value/count of a dimension. */ + private Number getDimValue( Review comment: Ah, also I see what you're saying about maintaining the existing behavior, which is that a `FacetResult` is not returned when there are no children seen (i.e., `getTopChildren` returns `null` and `getAllDims` doesn't include a result for the dim in this case). That's a little odd in my opinion since we _could_ return meaningful information that it had a `0` count and no children, but let's try to keep consistent behavior for now. So I would still recommend what I wrote above, but then in `getTopDims` I would check for a value of `0` and then skip over that dim (i.e., don't add it to your PQ). That way `getDimValue` can behave in a logical way and only `getTopDims` needs to know that it shouldn't include results with a zero count. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org