Merge pull request #22105 from geekpete/master
Fix Fuziness typo in multimatch error message and associated tests
This commit is contained in:
commit
7904028fef
|
@ -657,7 +657,7 @@ public class MultiMatchQueryBuilder extends AbstractQueryBuilder<MultiMatchQuery
|
||||||
|
|
||||||
if (fuzziness != null && (type == Type.CROSS_FIELDS || type == Type.PHRASE || type == Type.PHRASE_PREFIX)) {
|
if (fuzziness != null && (type == Type.CROSS_FIELDS || type == Type.PHRASE || type == Type.PHRASE_PREFIX)) {
|
||||||
throw new ParsingException(parser.getTokenLocation(),
|
throw new ParsingException(parser.getTokenLocation(),
|
||||||
"Fuziness not allowed for type [" + type.parseField.getPreferredName() + "]");
|
"Fuzziness not allowed for type [" + type.parseField.getPreferredName() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MultiMatchQueryBuilder(value)
|
return new MultiMatchQueryBuilder(value)
|
||||||
|
|
|
@ -271,7 +271,7 @@ public class MultiMatchQueryBuilderTests extends AbstractQueryTestCase<MultiMatc
|
||||||
"}";
|
"}";
|
||||||
|
|
||||||
ParsingException e = expectThrows(ParsingException.class, () -> parseQuery(json));
|
ParsingException e = expectThrows(ParsingException.class, () -> parseQuery(json));
|
||||||
assertEquals("Fuziness not allowed for type [" + type +"]", e.getMessage());
|
assertEquals("Fuzziness not allowed for type [" + type +"]", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,7 @@ public class QueryStringQueryBuilderTests extends AbstractQueryTestCase<QueryStr
|
||||||
assertThat(e.getMessage(), containsString("would result in more than 10000 states"));
|
assertThat(e.getMessage(), containsString("would result in more than 10000 states"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testToQueryFuzzyQueryAutoFuziness() throws Exception {
|
public void testToQueryFuzzyQueryAutoFuzziness() throws Exception {
|
||||||
assumeTrue("test runs only when at least a type is registered", getCurrentTypes().length > 0);
|
assumeTrue("test runs only when at least a type is registered", getCurrentTypes().length > 0);
|
||||||
|
|
||||||
int length = randomIntBetween(1, 10);
|
int length = randomIntBetween(1, 10);
|
||||||
|
|
Loading…
Reference in New Issue