Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GroupOptions is not working [DATASOLR-290] #410

spring-projects-issues opened this issue Apr 4, 2016 · 1 comment

GroupOptions is not working [DATASOLR-290] #410

spring-projects-issues opened this issue Apr 4, 2016 · 1 comment
in: core type: bug


Copy link

@spring-projects-issues spring-projects-issues commented Apr 4, 2016

Yogya H opened DATASOLR-290 and commented

In order to group results by personId I used the following code

Criteria cb =   PatientIndexCriteriaBuilder.getCriteriaBuilder(searchCriteria);
Query search = new SimpleQuery(cb);

Field field = new SimpleField("personId");
SimpleQuery groupQuery = new SimpleQuery(new SimpleStringCriteria("*:*"));
GroupOptions groupOptions = new GroupOptions()

GroupPage<PatientIndex> results= solrTemplate.queryForGroupPage(search, PatientIndex.class);

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.

Query search = new SimpleQuery(cb);
Page<PatientIndex> results = solrOperations.queryForPage(search, PatientIndex.class);

Affects: 1.5.4 (Gosling SR4)

Reference URL:

Copy link

@spring-projects-issues spring-projects-issues commented Oct 4, 2018

Partha commented

I am having a similar issue,

I have defined the group options as below :


private GroupOptions getGroupOptions(Pageable page, final String groupBy) {
   final Field groupByField = new SimpleField(groupBy);
   final GroupOptions groupOptions = new GroupOptions().addGroupByField(groupByField);
   return groupOptions;

// In the called function, I do :

final GroupOptions groupOptions = getGroupOptions(page, groupBy);
GroupPage<MyDocument> groupPage =
			 solrTemplate.queryForGroupPage(solrCollection, searchQuery,
// 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
in: core type: bug
None yet

No branches or pull requests

2 participants