idxSel.setNewRecordExists(true);
if (indexesInfo.getRecordFilterDependsOnRecordType()) {
// Because record type names can change, this is not guaranteed to be the same as what gets
// stored in the repo, but that doesn't matter as it is only for indexing purposes.
SchemaId oldRecordTypeId = typeMgr.getRecordTypeByName(originalRecord.getRecordTypeName(), null).getId();
idxSel.setOldRecordType(oldRecordTypeId);
// on update, specifying record type is optional
idxSel.setNewRecordType(record.getRecordTypeName() != null ?
typeMgr.getRecordTypeByName(record.getRecordTypeName(), null).getId() : oldRecordTypeId);
}