HI,

You can use the grouping in the solr. You can does this by via query or via
solrconfig.xml.

*A) via query*

http://localhost:8983?your_query_params*&group=true&group.field=bookName*

You can limit the size of group (how many documents you wants to show),
suppose you want to show 5 documents per group on this bookName field then
you can specify the parameter *group.limit=5.*

*B) via solrconfig*
<str name="group">true</str> <str name="group.field">*bookName*</str>
<str name="group.ngroups">true</str> <str name="group.truncate">true</str>

With Regards
Aman Tandon

On Sun, Dec 28, 2014 at 10:29 PM, S.L <simpleliving...@gmail.com> wrote:

> Hi All,
>
> I have a use case where I need to group documents that have a same field
> called bookName , meaning if there are a multiple documents with the same
> bookName value and if the user input is searched by a query on  bookName ,
> I need to be able to group all the documents by the same bookName together,
> so that I could display them as a group in the UI.
>
> What kind of support does Solr provide for such a scenario , and how should
> I look at changing my schema.xml which as bookName as single valued text
> field ?
>
> Thanks.
>

Reply via email to