[TEST] test that term query throws error when made against multiple fields
This commit is contained in:
parent
389bd06846
commit
6d228bb09c
|
@ -149,4 +149,24 @@ public class TermQueryBuilderTests extends AbstractTermQueryTestCase<TermQueryBu
|
|||
assertEquals("Geo fields do not support exact searching, use dedicated geo queries instead: [mapped_geo_point]",
|
||||
e.getMessage());
|
||||
}
|
||||
|
||||
public void testParseFailsWithMultipleFields() throws IOException {
|
||||
String json = "{\n" +
|
||||
" \"term\" : {\n" +
|
||||
" \"message1\" : {\n" +
|
||||
" \"value\" : \"this\"\n" +
|
||||
" },\n" +
|
||||
" \"message2\" : {\n" +
|
||||
" \"value\" : \"this\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
|
||||
try {
|
||||
parseQuery(json);
|
||||
fail("parseQuery should have failed");
|
||||
} catch(ParsingException e) {
|
||||
assertEquals("[term] query does not support different field names, use [bool] query instead", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue