private Object wrapWithFormatter(String format, final FieldExtractor createFieldExtractor) {
   // instantiate field extractor
   final IndexFormatter iformatter =
       ObjectUtils.instantiate(settings.getMappingIndexFormatterClassName(), settings);
   iformatter.configure(format);
   return new FieldExtractor() {
     @Override
     public String field(Object target) {
       return iformatter.format(createFieldExtractor.field(target));
     }
   };
 }
  public RestClient(Settings settings) {
    network = new NetworkClient(settings, SettingsUtils.nodes(settings));

    scrollKeepAlive = TimeValue.timeValueMillis(settings.getScrollKeepAlive());
    indexReadMissingAsEmpty = settings.getIndexReadMissingAsEmpty();

    String retryPolicyName = settings.getBatchWriteRetryPolicy();

    if (ConfigurationOptions.ES_BATCH_WRITE_RETRY_POLICY_SIMPLE.equals(retryPolicyName)) {
      retryPolicyName = SimpleHttpRetryPolicy.class.getName();
    } else if (ConfigurationOptions.ES_BATCH_WRITE_RETRY_POLICY_NONE.equals(retryPolicyName)) {
      retryPolicyName = NoHttpRetryPolicy.class.getName();
    }

    retryPolicy = ObjectUtils.instantiate(retryPolicyName, settings);
  }