1
votes

I am using solrnet and I have to group my results by one field "thisfield". In grouping I should return this:

group=true&group.field=thisfield&group.limit=100

In my code I use this:

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

But this code returns to me nothing, where is my problem? any ideas?

More info from putty:

I need to get this: INFO: webapp=/solr path=/select params={sort=sequentialid+desc,exchangetimestamp+desc&indent=true&q=destination:LUKA+OR+sender:LUKA&group.limit=100&_=1401690365440&group.field=breadcrumbid&group=true&wt=xml} hits=539927 status=0 QTime=76

I am getting this: INFO: webapp=/solr path=/select params={group.format=grouped&sort=sequentialid+desc,exchangetimestamp+desc&start=0&q=((((destination:LUKA))+OR+((sender:LUKA))))&group.limit=100&group.field=breadcrumbid&group=true&version=2.2&rows=15} hits=539927 status=0 QTime=76

1
Limit = 100, should be Limit = 100 ?Simcha Khabinsky
No diffrents, comma is not important in last row, I can have it, or not.geekforfreek
Maybe you are not assigning the Grouping parameter to the Query? Can you post the entire options setup?Simcha Khabinsky
Options setup? Do you mean my result from logs, I posted in quetion, from putty. First result is from my Solr Admin, second is from my application.geekforfreek
OK I figure out, it is nothing wrong with my code, problem is with that I am returning List instead Group.geekforfreek

1 Answers

1
votes

I don't think you have anything wrong in the query.

Just mind that if you do a grouping query in SolrNet you need to read results from

SolrQueryResults.Grouping.Values

instead of just using SolrQueryResults as a list, because the list will be empty.