mirror of https://github.com/apache/lucene.git
SOLR-13404: Fix NPE when group=true and no group.field is present
* This was introduced in SOLR-12249
This commit is contained in:
parent
cfd22cd493
commit
48b026d5ee
|
@ -286,10 +286,13 @@ public class QueryComponent extends SearchComponent
|
|||
if (req.getCore().getCoreContainer().isZooKeeperAware()) {
|
||||
IndexSchema schema = rb.req.getSchema();
|
||||
String[] fields = params.getParams(GroupParams.GROUP_FIELD);
|
||||
for (String field : fields) {
|
||||
SchemaField schemaField = schema.getField(field);
|
||||
if (schemaField.getType().isTokenized() && (schemaField.getType() instanceof SortableTextField) == false) {
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, String.format(Locale.ROOT, "Sorting on a tokenized field that is not a SortableTextField is not supported in cloud mode."));
|
||||
if (fields != null) {
|
||||
for (String field : fields) {
|
||||
SchemaField schemaField = schema.getField(field);
|
||||
if (schemaField.getType().isTokenized() && (schemaField.getType() instanceof SortableTextField) == false) {
|
||||
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, String.format(Locale.ROOT,
|
||||
"Sorting on a tokenized field that is not a SortableTextField is not supported in cloud mode."));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue