I have a requirement to group documents by count based on a particular field: 

So for example if you have the following three documents: 
   <doc>
          <id>1</id>
          <category>food</category>
          <body>car</body>
   </doc>
   <doc>
          <id>2</id>
          <category>travel</category>
          <body>car</body>
   </doc>
   <doc>
          <id>3</id>
          <category>food</category>
          <body>car</body>
   </doc>

A search with the query string 'car' based on a grouping based on the
'category' field should return something like:

   <doc>
          <id>1</id>
          <category>food</category>
          <body>car</body>
          <category_count>2</category_count>
   </doc>
   <doc>
          <id>2</id>
          <category>travel</category>
          <body>car</body>
          <category_count>1</category_count>
   </doc>
   <doc>
          <id>3</id>
          <category>food</category>
          <body>car</body>
          <category_count>2</category_count>
   </doc>

Is this possible?

Regards,
Sreekant



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Generating-a-document-by-group-count-and-displaying-the-result-tp4229183.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to