[TEST] make sure that the random query_string query generator defines a default_field or a list of fields
This commit is contained in:
parent
4a45579506
commit
a4365971a0
|
@ -787,7 +787,7 @@ public class MapperQueryParser extends QueryParser {
|
|||
fields = context.simpleMatchToIndexNames(field);
|
||||
} else {
|
||||
Map<String, Float> fieldsAndWeights = settings.fieldsAndWeights();
|
||||
fields = fieldsAndWeights == null ? Collections.emptyList() : settings.fieldsAndWeights().keySet();
|
||||
fields = fieldsAndWeights == null ? Collections.emptyList() : fieldsAndWeights.keySet();
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
|
|
@ -85,8 +85,7 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase<QueryStr
|
|||
if (randomBoolean()) {
|
||||
queryStringQueryBuilder.defaultField(randomBoolean() ?
|
||||
STRING_FIELD_NAME : randomAlphaOfLengthBetween(1, 10));
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
} else {
|
||||
int numFields = randomIntBetween(1, 5);
|
||||
for (int i = 0; i < numFields; i++) {
|
||||
String fieldName = randomBoolean() ? STRING_FIELD_NAME : randomAlphaOfLengthBetween(1, 10);
|
||||
|
|
Loading…
Reference in New Issue