TextMapper extends SingleColumnMapper.SingleFieldMapper<String> { @Override public SortField sortField(String name, boolean reverse) { throw new IndexException("Text mapper '{}' does not support sorting because it is analyzed", name); } TextMapper(String field, String column, Boolean validated, String analyzer); @Override Optional<Field> indexedField(String name, String value); @Override Optional<Field> sortedField(String name, String value); @Override SortField sortField(String name, boolean reverse); @Override String toString();  }
@Test(expected = IndexException.class) public void testSortField() { TextMapper mapper = textMapper().analyzer("SpanishAnalyzer").build("field"); mapper.sortField("field", true); }