code: private void addSubDimension(final Facets _facets,
                                   final DimValue _dimValue,
                                   final String _dim,
                                   final String _path)
          throws IOException
      {
          final FacetResult result = _facets.getTopChildren(1000, _dim, _path);
          if (result != null) {
              LOG.debug("FacetResult {}.", result);
              for (final LabelAndValue labelValue : result.labelValues) {
                  final DimValue dimValue = new DimValue().setLabel(labelValue.label)
                                  .setValue(labelValue.value.intValue());
                  dimValue.setPath(ArrayUtils.addAll(_dimValue.getPath(), result.path));
                  _dimValue.getChildren().add(dimValue);
                  addSubDimension(_facets, dimValue, _dim, _path + "/" + labelValue.label);
              }
          }
      }
docs: Recursive method to get the sub dimension.
  
  @param _facets the facets
  @param _dimValue the _dim value
  @param _dim the _dim
  @param _path the _path
  @throws IOException Signals that an I/O exception has occurred.