Schema implements Closeable { public List<IndexableField> indexableFields(Columns columns) { List<IndexableField> fields = new LinkedList<>(); mappers.values().forEach(mapper -> fields.addAll(mapper.bestEffortIndexableFields(columns))); return fields; } Schema(Analyzer defaultAnalyzer, Map<String, Mapper> mappers, Map<String, Analyzer> analyzers); Analyzer analyzer(String fieldName); Mapper mapper(String field); Set<String> mappedCells(); void validate(Columns columns); List<IndexableField> indexableFields(Columns columns); List<IndexableField> postProcessingIndexableFields(Columns columns, Search search); boolean mapsCell(String cell); @Override void close(); @Override String toString(); final Map<String, Mapper> mappers; final SchemaAnalyzer analyzer; final Analyzer defaultAnalyzer; }
@Test public void testIndexableFields() { Schema schema = SchemaBuilders.schema().mapper("field1", stringMapper()).build(); Columns columns = Columns.empty().add("field1", "value"); List<IndexableField> fields = schema.indexableFields(columns); assertFalse("Expected true", fields.isEmpty()); schema.close(); }