title: Nested aggregations in Searchkick
body: <p>I index for my model colors with id and name and when using aggregations with Searchkick, I need to have in the results both id and name in one hash, not separately. </p>
  
  <p>How to achieve that? </p>
  
  <p>This is how it works now:</p>
  
  <p><strong>Query</strong></p>
  
  <pre><code>2.1.3 :036 &gt; Product.search("slipy", aggs: ['colors.id','colors.name']).aggs
  </code></pre>
  
  <p><strong>Results</strong></p>
  
  <p>As you can see the id and name is in separate hash and so the relationship  is broken. </p>
  
  <pre><code>{"colors.name"=&gt;{"doc_count_error_upper_bound"=&gt;0, "sum_other_doc_count"=&gt;0, "buckets"=&gt;[{"key"=&gt;"black", "doc_count"=&gt;149}, {"key"=&gt;"white", "doc_count"=&gt;124}, {"key"=&gt;"blue", "doc_count"=&gt;102}, {"key"=&gt;"red", "doc_count"=&gt;57}, {"key"=&gt;"yellow", "doc_count"=&gt;35}, {"key"=&gt;"grey", "doc_count"=&gt;26}, {"key"=&gt;"turquoise", "doc_count"=&gt;18}, {"key"=&gt;"green", "doc_count"=&gt;17}, {"key"=&gt;"orange", "doc_count"=&gt;8}, {"key"=&gt;"pink", "doc_count"=&gt;8}, {"key"=&gt;"purple", "doc_count"=&gt;3}, {"key"=&gt;"none", "doc_count"=&gt;2}]}, "colors.id"=&gt;{"doc_count_error_upper_bound"=&gt;0, "sum_other_doc_count"=&gt;0, "buckets"=&gt;[{"key"=&gt;2, "doc_count"=&gt;149}, {"key"=&gt;13, "doc_count"=&gt;124}, {"key"=&gt;3, "doc_count"=&gt;102}, {"key"=&gt;4, "doc_count"=&gt;57}, {"key"=&gt;6, "doc_count"=&gt;35}, {"key"=&gt;7, "doc_count"=&gt;26}, {"key"=&gt;10, "doc_count"=&gt;18}, {"key"=&gt;5, "doc_count"=&gt;17}, {"key"=&gt;8, "doc_count"=&gt;8}, {"key"=&gt;9, "doc_count"=&gt;8}, {"key"=&gt;11, "doc_count"=&gt;3}, {"key"=&gt;1, "doc_count"=&gt;2}]}}
  </code></pre>
  
  <p>The purpose of having this is to generate various filters where I need ID for backend and name for frontend. If this is not possible with searchkick, is there any other "workaround" how to achieve this? </p>
  
  <p>Thank you, Miro</p>