cpoerschke commented on a change in pull request #300: SOLR-11831: Skip second
grouping step if group.limit is 1 (aka Las Vegas Patch)
URL: https://github.com/apache/lucene-solr/pull/300#discussion_r311203284
##########
File path:
solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/GroupedEndResultTransformer.java
##########
@@ -75,7 +75,13 @@ public void transform(Map<String, ?> result,
ResponseBuilder rb, SolrDocumentSou
SimpleOrderedMap<Object> groupResult = new SimpleOrderedMap<>();
if (group.groupValue != null) {
// use createFields so that fields having doc values are also
supported
- List<IndexableField> fields =
groupField.createFields(group.groupValue.utf8ToString());
+ final String groupValue;
+ if (rb.getGroupingSpec().isSkipSecondGroupingStep()) {
+ groupValue =
groupField.getType().indexedToReadable(group.groupValue.utf8ToString());
Review comment:
I struggled (again) to comprehend why this change is needed.
https://github.com/cpoerschke/lucene-solr/commit/20129e7d3f7e12f442254e780e7da9a590a9036b
proposes to factor out a local `bytesRefToString` functor with fairly detailed
comments. What do you think?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]