use of io.searchbox.indices.ForceMerge in project graylog2-server by Graylog2.
the class IndicesAdapterES6 method optimizeIndex.
@Override
public void optimizeIndex(String index, int maxNumSegments, Duration timeout) {
final RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(Ints.saturatedCast(timeout.toMilliseconds())).build();
final ForceMerge request = new ForceMerge.Builder().addIndex(index).maxNumSegments(maxNumSegments).flush(true).onlyExpungeDeletes(false).build();
JestUtils.execute(jestClient, requestConfig, request, () -> "Couldn't force merge index " + index);
}
Aggregations