Search code examples
solrsolrnetfieldcollapsing

Solrnet grouping - can I get n results per group


I am using solrnet 0.40 grouping functionality. And I am grouping on a single field (say filename).

But in the results I would like to display multiple hits for the group (filename).

  • FileName-1

    • hit-1, hit-2....hit-n
  • FileName-2

    • hit-1, hit-2....

and so on....

Is there any way grouping gives me the functionality to get results clustered other than the obvious way of running a secondary query for each group?

TIA


Solution

  • Just needed to set the grouping params to desired value. For example, have set it to 10 to get 10 results per group.

     Grouping = new GroupingParameters()
            {
                Fields = new [] { "manu_exact" },
                Format = GroupingFormat.Grouped,
                Limit = 10,
            }