user1808036
user1808036

Reputation: 11

Solr 4.0 and SolrNet to get groups ordered by document count

I’m using Solr 4.0, SolrNet and C#.

I'm trying to get top 10 or 5 highest ranked ( i.e product groups ordered by number of products in a group) product groups as search result out of many products in solr. Fetching all product groups according to search criteria and applying LINQ on those groups to sort on basis of document counts and then getting top 10 groups as result would be an option but first it would fetch all groups matching the search criteria into application to apply LINQ makes the use of solr meaning less.

Is it possible to get search result directly from Solr sorted by product groups having more number of products on top using SolrNet 4.0 ?

Thanks


and for above code Solr 4.0 is returning the result in Grouping property and it has 2 GroupedResults 1 for DestCityCode and 2nd for OriginCityCode. To put my point clear, I'm considering only one GroupedResult i.e. "DestCityCode" In Value property it has 2 Groups one for "STL" and another is "CUL". For "STL" group has Numfound=9 and "CUL" group has NumFound=1. and similarly for GroupedResult "OriginCityCode"

Is it possible to get doc counts and documents grouped by distinct city pairs and NOT as one group per city ? Also I didn't find any documentation related to "Func" and "Query" property of GroupedParameters. Would it help anyway to get my expected result as distinct city pairs?

Thanks in advance.

Upvotes: 1

Views: 1043

Answers (1)

Jayendra
Jayendra

Reputation: 52779

Its a work in progress and the feature is not currently supported by Solr.

Comment :-

Right now, the sort value for a group (that governs how whole groups sort relative to eachother) depends only on the top document in that group. This issue is about a different type of function that can derive a group sort value from something else. One example is being able to sort groups based on the average score in that group rather than just the top score. Another example is being able to sort by the number of hits in each group.

Upvotes: 1

Related Questions