use of org.opensearch.action.index.IndexResponse in project fess by codelibs.
the class EsAbstractBehavior method delegateInsert.
// ===================================================================================
// Update
// ======
@Override
protected int delegateInsert(final Entity entity, final InsertOption<? extends ConditionBean> option) {
final EsAbstractEntity esEntity = (EsAbstractEntity) entity;
IndexRequestBuilder builder = createInsertRequest(esEntity);
final IndexResponse response = builder.execute().actionGet(indexTimeout);
esEntity.asDocMeta().id(response.getId());
return response.getResult() == Result.CREATED ? 1 : 0;
}
Aggregations