SOLR-9783: (Search|Top)Group[s]ShardResponseProcessor.process: turned sortWithinGroup null check into assert.

Also sort.equals tweak in (grouping) QueryCommand.create method.
This commit is contained in:
Christine Poerschke 2016-11-28 19:58:25 +01:00
parent 70b358960d
commit 02c687758e
4 changed files with 6 additions and 7 deletions

View File

@ -245,6 +245,9 @@ Other Changes
* SOLR-9801: Upgrade jetty to 9.3.14.v20161028 (shalin)
* SOLR-9783: (Search|Top)Group[s]ShardResponseProcessor.process: turned sortWithinGroup null check into assert.
(Christine Poerschke)
================== 6.3.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -124,7 +124,7 @@ public class QueryCommand implements Command<QueryCommandResult> {
@Override
public List<Collector> create() throws IOException {
if (sort == null || sort == Sort.RELEVANCE) {
if (sort == null || sort.equals(Sort.RELEVANCE)) {
collector = TopScoreDocCollector.create(docsToCollect);
} else {
collector = TopFieldCollector.create(sort, docsToCollect, true, needScores, needScores);

View File

@ -52,9 +52,7 @@ public class SearchGroupShardResponseProcessor implements ShardResponseProcessor
Sort groupSort = rb.getGroupingSpec().getGroupSort();
final String[] fields = rb.getGroupingSpec().getFields();
Sort sortWithinGroup = rb.getGroupingSpec().getSortWithinGroup();
if (sortWithinGroup == null) { // TODO prevent it from being null in the first place
sortWithinGroup = Sort.RELEVANCE;
}
assert sortWithinGroup != null;
final Map<String, List<Collection<SearchGroup<BytesRef>>>> commandSearchGroups = new HashMap<>(fields.length, 1.0f);
final Map<String, Map<SearchGroup<BytesRef>, Set<String>>> tempSearchGroupToShards = new HashMap<>(fields.length, 1.0f);

View File

@ -61,9 +61,7 @@ public class TopGroupsShardResponseProcessor implements ShardResponseProcessor {
String[] fields = rb.getGroupingSpec().getFields();
String[] queries = rb.getGroupingSpec().getQueries();
Sort sortWithinGroup = rb.getGroupingSpec().getSortWithinGroup();
if (sortWithinGroup == null) { // TODO prevent it from being null in the first place
sortWithinGroup = Sort.RELEVANCE;
}
assert sortWithinGroup != null;
// If group.format=simple group.offset doesn't make sense
int groupOffsetDefault;