Yuti-G commented on a change in pull request #747: URL: https://github.com/apache/lucene/pull/747#discussion_r832745109
########## File path: lucene/facet/src/java/org/apache/lucene/facet/sortedset/SortedSetDocValuesFacetCounts.java ########## @@ -178,10 +229,23 @@ private FacetResult getPathResult( } } - if (q == null) { - return null; + if (dimConfig.hierarchical == false) { Review comment: Thanks @gsmiller! Sorry that I didn't explain my code clear. > What about getTopChildren? It looks like it could call getPathResult for a hierarchical + multivalued case. Maybe I'm just missing something? For the hierarchical + multivalued case, the return statement in `getPathResult`will set dimCount = counts[pathOrd]. The logic here is that when a dim is hierarchical, dimCount will always equal to counts[pathOrd] regardless of the boolean value multivalued, and therefore, we only need to be concerned about the case when hierarchical == false, which is checked in `getChildOrdsResult`. I added tests for `getTopChildren`, `getAllDims`, and `getTopChildren` to test different boolean combinations of `hierarchical`, `multivalued`, and `requireDimCount` to ensure the current design does not change the existing logic for other functionalities but only add support to `getTopDims`, and `getChildOrdsResult` does not rely on `getDimValue` to provide/reset dimCount. Please let me know if I am missing anything here. Thanks again! -- 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