Solr Grouping is unlike to generate the response like that directly.
Solr group response result is grouped by field, while you want FLAT format
result.
Flattern result self should be easy task, but may cause another problem,
how to control Navigation/Pagination behavior?  that depends on your
application requirement.

Best,
Ronald

On Wed, Sep 16, 2015 at 11:39 AM, Erick Erickson <erickerick...@gmail.com>
wrote:

> Have you looked at the group by options? See:
> https://cwiki.apache.org/confluence/display/solr/Result+Grouping
>
> Best,
> Erick
>
> On Tue, Sep 15, 2015 at 5:00 AM, Sreekant Sreedharan
> <sreeka...@alamy.com> wrote:
> > 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