title: lucene group by
body: <p>hi have index simple document where you have 2 fields:</p>
  
  <pre><code>1. profileId as long
  
  2. profileAttribute as long.
  </code></pre>
  
  <p>i need to know how many profileId's have a certain set of attribute.</p>
  
  <p>for example i index:</p>
  
  <pre><code>doc1: profileId:1 , profileAttribute = 55
  doc2: profileId:1 , profileAttribute = 57
  doc3: profileId:2 , profileAttribute = 55
  </code></pre>
  
  <p>and i want to know how many profiles have both attribute 55 and 57 
  in this example the answer is 1 cuz only profile id 1 have both attributes</p>
  
  <p>thanks in advance for your help</p>