code: private static RestRepository initMultiIndices(Settings settings, long currentInstance, Resource resource, Log log) {
          if (log.isDebugEnabled()) {
              log.debug(String.format("Resource [%s] resolves as an index pattern", resource));
          }
  
          // multi-index write - since we don't know before hand what index will be used, use an already selected node
          String node = SettingsUtils.getPinnedNode(settings);
          if (log.isDebugEnabled()) {
              log.debug(String.format("Partition writer instance [%s] assigned to [%s]", currentInstance, node));
          }
  
          return new RestRepository(settings);
      }
docs: Creates a RestRepository for use with a multi-index resource pattern. The client is left pinned
  to the original node that it was pinned to since the shard locations cannot be determined at all.
  @param settings Job settings
  @param currentInstance Partition number
  @param resource Configured write resource
  @param log Logger to use
  @return The RestRepository to be used by the partition writer