privateGroupOptionsgetGroupOptions(Pageablepage, finalStringgroupBy) {
finalFieldgroupByField = newSimpleField(groupBy);
finalGroupOptionsgroupOptions = newGroupOptions().addGroupByField(groupByField);
groupOptions.setTotalCount(true);
groupOptions.setOffset(Long.valueOf(page.getOffset()).intValue());
groupOptions.setLimit(Long.valueOf(page.getPageSize()).intValue());
returngroupOptions;
}
// In the called function, I do :finalGroupOptionsgroupOptions = getGroupOptions(page, groupBy);
GroupPage<MyDocument> groupPage =
solrTemplate.queryForGroupPage(solrCollection, searchQuery,
MyDocument.class);
// I get : Page 1 of 0 UNKNOWN instances in the log.
If i follow the suggestion of Yogya, I am able to group by. Looks like your GroupOptions feature and GroupPage, are broken
Yogya H opened DATASOLR-290 and commented
In order to group results by personId I used the following code
The returning result is not group by the person Id.
But instead of using groupoptions If I use the following code, The returning data is properly group by the personId.
Affects: 1.5.4 (Gosling SR4)
Reference URL: http://stackoverflow.com/questions/36336816/spring-data-solr-groupoptions-is-not-working
The text was updated successfully, but these errors were encountered: