[TEST] test that term query short syntax throws error when multiple fields are provided

This commit is contained in:
javanna 2016-08-09 09:50:12 +02:00 committed by Luca Cavanna
parent 27a6983646
commit bbf40ca0cf
1 changed files with 9 additions and 0 deletions

View File

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