mirror of https://github.com/apache/lucene.git
TestRerankBase.getModelInJson to permit empty features array.
This commit is contained in:
parent
0c831b9970
commit
708ed8fb48
|
@ -239,12 +239,14 @@ public class TestRerankBase extends RestTestBase {
|
|||
.append(",\n");
|
||||
sb.append("\"class\":").append('"').append(type).append('"').append(",\n");
|
||||
sb.append("\"features\":").append('[');
|
||||
for (final String feature : features) {
|
||||
sb.append("\n\t{ ");
|
||||
sb.append("\"name\":").append('"').append(feature).append('"')
|
||||
.append("},");
|
||||
if (features.length > 0) {
|
||||
for (final String feature : features) {
|
||||
sb.append("\n\t{ ");
|
||||
sb.append("\"name\":").append('"').append(feature).append('"')
|
||||
.append("},");
|
||||
}
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
}
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
sb.append("\n]\n");
|
||||
if (params != null) {
|
||||
sb.append(",\n");
|
||||
|
|
Loading…
Reference in New Issue