Query parsedQuery = queryParser.parse(filteredQuery(termQuery("name.first", "shay"), rangeFilter("age").from(23).to(54).includeLower(true).includeUpper(false))).query();
// since age is automatically registered in data, we encode it as numeric
assertThat(parsedQuery, instanceOf(FilteredQuery.class));
Filter filter = ((FilteredQuery) parsedQuery).getFilter();
assertThat(filter, instanceOf(NumericRangeFilter.class));
NumericRangeFilter rangeFilter = (NumericRangeFilter) filter;
assertThat(rangeFilter.getField(), equalTo("age"));
assertThat(rangeFilter.getMin().intValue(), equalTo(23));
assertThat(rangeFilter.getMax().intValue(), equalTo(54));
assertThat(rangeFilter.includesMin(), equalTo(true));
assertThat(rangeFilter.includesMax(), equalTo(false));
}