Merge pull request #22105 from geekpete/master

Fix Fuziness typo in multimatch error message and associated tests
This commit is contained in:
Peter Dyson 2016-12-12 23:13:20 +10:00 committed by GitHub
commit 7904028fef
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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());
} }
} }

View File

@ -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);