use of org.opensearch.action.admin.indices.mapping.put.PutMappingRequestBuilder in project fess by codelibs.
the class UpgradeUtil method putMapping.
public static boolean putMapping(final IndicesAdminClient indicesClient, final String index, final String type, final String source) {
try {
final PutMappingRequestBuilder builder = indicesClient.preparePutMapping(index).setSource(source, XContentType.JSON);
final AcknowledgedResponse pmResponse = builder.execute().actionGet();
if (pmResponse.isAcknowledged()) {
return true;
}
logger.warn("Failed to update {} settings.", index);
} catch (final Exception e) {
logger.warn("Failed to update {} settings.", index, e);
}
return false;
}
Aggregations