diff --git a/core/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java index 276768183b0..14e5054c5e1 100644 --- a/core/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/TermQueryBuilderTests.java @@ -155,5 +155,14 @@ public class TermQueryBuilderTests extends AbstractTermQueryTestCase parseQuery(json)); assertEquals("[term] query does not support different field names, use [bool] query instead", e.getMessage()); + + String shortJson = "{\n" + + " \"term\" : {\n" + + " \"message1\" : \"this\",\n" + + " \"message2\" : \"this\"\n" + + " }\n" + + "}"; + e = expectThrows(ParsingException.class, () -> parseQuery(shortJson)); + assertEquals("[term] query does not support different field names, use [bool] query instead", e.getMessage()); } }