|
@@ -247,6 +247,14 @@ public class QueryStringIT extends ESIntegTestCase {
|
|
|
assertHitCount(resp, 1L);
|
|
|
}
|
|
|
|
|
|
+ public void testBooleanStrictQuery() throws Exception {
|
|
|
+ Exception e = expectThrows(Exception.class, () ->
|
|
|
+ client().prepareSearch("test").setQuery(
|
|
|
+ queryStringQuery("foo").field("f_bool")).get());
|
|
|
+ assertThat(ExceptionsHelper.detailedMessage(e),
|
|
|
+ containsString("Can't parse boolean value [foo], expected [true] or [false]"));
|
|
|
+ }
|
|
|
+
|
|
|
private void assertHits(SearchHits hits, String... ids) {
|
|
|
assertThat(hits.totalHits(), equalTo((long) ids.length));
|
|
|
Set<String> hitIds = new HashSet<>();
|