[TEST] test that term query short syntax throws error when multiple fields are provided
This commit is contained in:
parent
27a6983646
commit
bbf40ca0cf
|
@ -155,5 +155,14 @@ public class TermQueryBuilderTests extends AbstractTermQueryTestCase<TermQueryBu
|
|||
"}";
|
||||
ParsingException e = expectThrows(ParsingException.class, () -> 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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue