@Override public List<SolrDocument> getResponseDocuments(QueryResponse response) { List<SolrDocument> docs; if (response.getGroupResponse() == null) { docs = response.getResults(); } else { docs = new ArrayList<SolrDocument>(); GroupResponse gr = response.getGroupResponse(); for (GroupCommand gc : gr.getValues()) { for (Group g : gc.getValues()) { for (SolrDocument d : g.getResult()) { docs.add(d); } } } } return docs; }
for (Group group : groupCommand.getValues()) { int matches = groupCommand.getMatches(); Integer ngroups = groupCommand.getNGroups(); String name = groupCommand.getName();
List<Group> groups = groupCommand.getValues(); long totalNumFound = groupCommand.getNGroups();
if (oNGroups != null) { Integer iNGroups = (Integer) oNGroups; groupedCommand = new GroupCommand(fieldName, iMatches, iNGroups); } else { groupedCommand = new GroupCommand(fieldName, iMatches); SolrDocumentList doclist = (SolrDocumentList) grpMap.get( "doclist"); Group group = new Group(sGroupValue != null ? sGroupValue.toString() : null, doclist) ; groupedCommand.add(group); if (oNGroups != null) { Integer iNGroups = (Integer) oNGroups; groupCommand = new GroupCommand(fieldName, iMatches, iNGroups); } else { groupCommand = new GroupCommand(fieldName, iMatches); groupCommand.add(new Group(fieldName, docList)); _groupResponse.add(groupCommand);
@Override public void accept(GroupCommand comm) { if (groupingField != null && !groupingField.equals(comm.getName())) return; List<Group> groups = comm.getValues(); if (groups != null) { for (Group group : groups) { Consumer<SolrDocument> consumer = consumers.get(group.getGroupValue()); if (consumer != null) group.getResult().forEach(consumer); } } } };
GroupResponse gResponse = response.getGroupResponse(); for (GroupCommand gCommand : gResponse.getValues()) { total += gCommand.getNGroups(); for (Group group : gCommand.getValues()) { docs.addAll(server.getBinder().getBeans(Document.class, group.getResult()));
if (oNGroups != null) { Integer iNGroups = (Integer) oNGroups; groupedCommand = new GroupCommand(fieldName, iMatches, iNGroups); } else { groupedCommand = new GroupCommand(fieldName, iMatches); SolrDocumentList doclist = (SolrDocumentList) grpMap.get( "doclist"); Group group = new Group(sGroupValue != null ? sGroupValue.toString() : null, doclist) ; groupedCommand.add(group); if (oNGroups != null) { Integer iNGroups = (Integer) oNGroups; groupCommand = new GroupCommand(fieldName, iMatches, iNGroups); } else { groupCommand = new GroupCommand(fieldName, iMatches); groupCommand.add(new Group(fieldName, docList)); _groupResponse.add(groupCommand);
GroupCommand groupCommand = groupCommands.get(0); List<Group> groups = groupCommand.getValues();