title: hierarchical faceting with Elasticsearch
body: <p>I'm using elasticsearch and need to implement facet search for hierarchical object as follow:</p>
  
  <ul>
  <li>category 1 (10)
  
  <ul>
  <li>subcategory 1 (4)</li>
  <li>subcategory 2 (6)</li>
  </ul></li>
  <li>category 2 (X)
  
  <ul>
  <li>...</li>
  </ul></li>
  </ul>
  
  <p>So I need to get facets for two related objects. Documentation says that it's possible to get such kind of facets for numeric value, but I need it for strings <a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-stats-facet.html" rel="noreferrer">http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-terms-stats-facet.html</a></p>
  
  <p>Here is another interesting topic, unfortunately it's old: <a href="http://elasticsearch-users.115913.n3.nabble.com/Pivot-facets-td2981519.html" rel="noreferrer">http://elasticsearch-users.115913.n3.nabble.com/Pivot-facets-td2981519.html</a></p>
  
  <p>Does it possible with elastic search?
  If so, how can I do that?</p>