geekforfreek
geekforfreek

Reputation: 146

Why is solr grouping returns zero?

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

Upvotes: 1

Views: 150

Answers (1)

Emad
Emad

Reputation: 544

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.

Upvotes: 1

Related Questions