title: Solr : How can I group on two different fields?
body: <p>My schema is like :</p>
  
  <pre><code>product_id  
  category_id
  </code></pre>
  
  <p>A category contains products.<br>
  In solr 3.6, I group results on category_id and it works well.</p>
  
  <p>I just added a new field: </p>
  
  <pre><code>group_id
  </code></pre>
  
  <p>A group contains products that vary on size or color.<br>
  Example: shoes in blue, red and yellow are 3 differents products and have the same group_id.</p>
  
  <p>Additionally to the result grouping on field category_id, I would like to have in my results only one product for a group_id, assuming group_id can be null (for products that aren't part of a group).</p>
  
  <p>To follow the example of the shoes, it means that for the request "shoe", only one of the 3 products should be in results.</p>
  
  <p>I thought to do a second result grouping on group_id, but I doesn't seem possible to do that way.</p>
  
  <p>Any idea?</p>
  
  <p>EDIT : For now, i process the results in php to delete documents that have a group_id that is already in the results. I leave this subject open, in case someone finds how to group on 2 fields</p>