DateRangeMapper extends MultipleColumnMapper { @Override public SortField sortField(String name, boolean reverse) { throw new IndexException("Date range mapper '{}' does not support sorting", name); } DateRangeMapper(String field, Boolean validated, String from, String to, String pattern); @Override List<IndexableField> indexableFields(Columns columns); @Override SortField sortField(String name, boolean reverse); NRShape makeShape(Date from, Date to); Date base(Object value); @Override String toString(); final String from; final String to; final DateParser parser; final NumberRangePrefixTreeStrategy strategy; }
@Test(expected = IndexException.class) public void testSortField() { DateRangeMapper mapper = dateRangeMapper("to", "from").build("field"); mapper.sortField("field", false); }