@Override public ActionRequest request(IndexRecord record, long timestamp, String user) { log.debug( "updating record " + record.id() + " for " + record.type() + " at " + record.index()); return new IndexRequest(record.index(), record.type(), record.id()) .source(sourceOf(record, timestamp, user)) .parent(record.parent()) .versionType(VersionType.EXTERNAL_GTE) .version(timestamp); }
@Override public ActionRequest request(IndexRecord record, long timestamp, String user) { final String id = emptyToNull(record.id()); // auto-generate if empty log.debug( "overwriting record " + nonNull(id, "_auto_") + " for " + record.type() + " at " + record.index()); return new IndexRequest(record.index(), record.type(), id) .source(sourceOf(record, timestamp, user)) .parent(record.parent()) .versionType(VersionType.FORCE) .version(timestamp); }