diff --git a/core/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java index c9667c98778..9f081d95ec2 100644 --- a/core/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/MatchPhraseQueryBuilder.java @@ -207,6 +207,10 @@ public class MatchPhraseQueryBuilder extends AbstractQueryBuilder parseQuery(json)); assertEquals("[match_phrase] query doesn't support multiple fields, found [message1] and [message2]", e.getMessage()); + + String shortJson = "{\n" + + " \"match_phrase\" : {\n" + + " \"message1\" : \"this is a test\",\n" + + " \"message2\" : \"this is a test\"\n" + + " }\n" + + "}"; + e = expectThrows(ParsingException.class, () -> parseQuery(shortJson)); + assertEquals("[match_phrase] query doesn't support multiple fields, found [message1] and [message2]", e.getMessage()); } }