Apache Lucene open-source search software
SOLR-9660: rename GroupSpecification's sortSpecWithinGroup to withinGroupSortSpec (Judith Silverman via Christine Poerschke)
Christine Poerschkebc8936a567e4
diff --git a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.javaindex 84ade43c7a5..9bd5efb32a5 100644--- a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java+++ b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java@@ -255,23 +255,23 @@ public class QueryComponent extends SearchComponentfinal SortSpec groupSortSpec = searcher.weightSortSpec(sortSpec, Sort.RELEVANCE);// groupSort defaults to sort- String sortWithinGroupStr = params.get(GroupParams.GROUP_SORT);+ String withinGroupSortStr = params.get(GroupParams.GROUP_SORT);//TODO: move weighting of sort- final SortSpec sortSpecWithinGroup;- if (sortWithinGroupStr != null) {- SortSpec parsedSortSpecWithinGroup = SortSpecParsing.parseSortSpec(sortWithinGroupStr, req);- sortSpecWithinGroup = searcher.weightSortSpec(parsedSortSpecWithinGroup, Sort.RELEVANCE);+ final SortSpec withinGroupSortSpec;+ if (withinGroupSortStr != null) {+ SortSpec parsedWithinGroupSortSpec = SortSpecParsing.parseSortSpec(withinGroupSortStr, req);+ withinGroupSortSpec = searcher.weightSortSpec(parsedWithinGroupSortSpec, Sort.RELEVANCE);} else {- sortSpecWithinGroup = new SortSpec(+ withinGroupSortSpec = new SortSpec(groupSortSpec.getSort(),groupSortSpec.getSchemaFields(),groupSortSpec.getCount(),groupSortSpec.getOffset());}- sortSpecWithinGroup.setOffset(params.getInt(GroupParams.GROUP_OFFSET, 0));- sortSpecWithinGroup.setCount(params.getInt(GroupParams.GROUP_LIMIT, 1));+ withinGroupSortSpec.setOffset(params.getInt(GroupParams.GROUP_OFFSET, 0));+ withinGroupSortSpec.setCount(params.getInt(GroupParams.GROUP_LIMIT, 1));- groupingSpec.setSortSpecWithinGroup(sortSpecWithinGroup);+ groupingSpec.setWithinGroupSortSpec(withinGroupSortSpec);groupingSpec.setGroupSortSpec(groupSortSpec);String formatStr = params.get(GroupParams.GROUP_FORMAT, Grouping.Format.grouped.name());diff --git a/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java b/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.javaindex f72fc89a66a..25157cfb7ba 100644--- a/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java+++ b/solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java@@ -465,10 +465,10 @@ public class QueryElevationComponent extends SearchComponent implements SolrCoreif (modGroupSortSpec != null) {groupingSpec.setGroupSortSpec(modGroupSortSpec);}- SortSpec withinGroupSortSpec = groupingSpec.getSortSpecWithinGroup();+ SortSpec withinGroupSortSpec = groupingSpec.getWithinGroupSortSpec();SortSpec modWithinGroupSortSpec = this.modifySortSpec(withinGroupSortSpec, force, comparator);if (modWithinGroupSortSpec != null) {- groupingSpec.setSortSpecWithinGroup(modWithinGroupSortSpec);+ groupingSpec.setWithinGroupSortSpec(modWithinGroupSortSpec);}}}diff --git a/solr/core/src/java/org/apache/solr/search/grouping/GroupingSpecification.java b/solr/core/src/java/org/apache/solr/search/grouping/GroupingSpecification.javaindex 4194dd087f8..e1e276e5a28 100644--- a/solr/core/src/java/org/apache/solr/search/grouping/GroupingSpecification.java+++ b/solr/core/src/java/org/apache/solr/search/grouping/GroupingSpecification.java@@ -31,7 +31,7 @@ public class GroupingSpecification {private String[] queries = new String[]{};private String[] functions = new String[]{};private SortSpec groupSortSpec;- private SortSpec sortSpecWithinGroup;+ private SortSpec withinGroupSortSpec;private boolean includeGroupCount;private boolean main;private Grouping.Format responseFormat;@@ -76,7 +76,7 @@ public class GroupingSpecification {@Deprecatedpublic int getWithinGroupOffset() {- return sortSpecWithinGroup.getOffset();+ return withinGroupSortSpec.getOffset();}@Deprecatedpublic int getGroupOffset() {@@ -86,8 +86,9 @@ public class GroupingSpecification {@Deprecatedpublic int getWithinGroupLimit() {- return sortSpecWithinGroup.getCount();+ return withinGroupSortSpec.getCount();}+@Deprecatedpublic int getGroupLimit() {return getWithinGroupLimit();@@ -114,10 +115,9 @@ public class GroupingSpecification {@Deprecatedpublic Sort getSortWithinGroup() {- return sortSpecWithinGroup.getSort();+ return withinGroupSortSpec.getSort();}-public boolean isIncludeGroupCount() {return includeGroupCount;}@@ -166,12 +166,12 @@ public class GroupingSpecification {this.groupSortSpec = groupSortSpec;}- public SortSpec getSortSpecWithinGroup() {- return sortSpecWithinGroup;+ public SortSpec getWithinGroupSortSpec() {+ return withinGroupSortSpec;}- public void setSortSpecWithinGroup(SortSpec sortSpecWithinGroup) {- this.sortSpecWithinGroup = sortSpecWithinGroup;+ public void setWithinGroupSortSpec(SortSpec withinGroupSortSpec) {+ this.withinGroupSortSpec = withinGroupSortSpec;}}