mirror of https://github.com/apache/lucene.git
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:
parent
70b358960d
commit
02c687758e
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue