indexUpdateBuilder.addDependency(fieldType.getId());
}
IdGenerator idGenerator = indexUpdateBuilder.getRepository().getIdGenerator();
RecordContext ctx = indexUpdateBuilder.getRecordContext();
LRepository repository = indexUpdateBuilder.getRepository();
// FIXME: it's more efficient to read all records at once
// but make sure missing records are also treated (handled here via null linkedRecord in case of RecordNotFoundException
if (ctx.record != null) {
List links = IndexerUtils.flatList(ctx.record, fieldType);
for (Link link: (List<Link>)links) {
RecordId linkedRecordId = link.resolve(ctx.contextRecord, idGenerator);
Record linkedRecord = null;
String tableName = link.getTable() != null ? link.getTable() : indexUpdateBuilder.getTable();
LTable table = repository.getTable(tableName);
try {
linkedRecord = VersionTag.getIdRecord(linkedRecordId, indexUpdateBuilder.getVTag(), table, repository);
} catch (RecordNotFoundException rnfe) {
// ok, continue with null value
} catch (VersionNotFoundException e) {