Upsert data a sync with object mapper action future.

@param sourceObject the source object
@param index        the index
@param type         the type
@param id           the id
@return the action future
359499
public ActionFuture<UpdateResponse>
    upsertDataASyncWithObjectMapper(Object sourceObject, String index,
            String type, String id) {
        return upsertDataAsync(
                JMElasticsearchUtil.buildSourceByJsonMapper(sourceObject),
                index, type, id);
    }
1205232
public static function add($action, $type, $id = null)
    {
        if (!is_null($id))
            self::$modelMap[$type][$id] = $action;
        else
            self::$typeMap[$type] = $action;
    }
199159
public QueryParameters updateType(String key, Integer type) {
        this.types.put(processKey(key), type);

        return this;
    }
892793
public ActionFuture<IndexResponse> sendDataAsyncWithObjectMapper(
            Object sourceObject, String index, String type, String id) {
        return indexQueryAsync(buildIndexRequest(
                JMElasticsearchUtil.buildSourceByJsonMapper(sourceObject),
                index, type, id));
    }
467713
public function getSource($index, $type, $id)
    {
        return $this->db->get([$index, $type, $id]);
    }
91818
@SuppressWarnings("unchecked")
  public <T extends Entry<T>> T acquire(Class<T> type, long index) {
    ReferencePool<T> pool = (ReferencePool<T>) pools.get(type);
    if (pool == null) {
      try {
        Constructor<T> c = type.getConstructor(ReferenceManager.class);
        c.setAccessible(true);
        pool = new ReferencePool<>((r) -> {
          try {
            return c.newInstance(r);
          } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
            throw new StorageException(e);
          }
        });
      }
405305
private void updateEntity(String type, String id, XContentBuilder source) throws StorageException {
        try {
            String doc = source.string();
            /* JestResult response = */esClient.execute(new Index.Builder(doc)
                    .setParameter(Parameters.OP_TYPE, "index").index(getIndexName()).type(type).id(id).build()); //$NON-NLS-1$
        } catch (Exception e) {
            throw new StorageException(e);
        }
    }
149912
public function update($index, $type, $id, $data, $options = [])
    {
        $body = [
            'doc' => empty($data) ? new \stdClass() : $data,
        ];
        if (isset($options["detect_noop"])) {
            $body["detect_noop"] = $options["detect_noop"];
            unset($options["detect_noop"]);
        }

        return $this->db->post([$index, $type, $id, '_update'], $options, Json::encode($body));
    }
92496
public void sendWithBulkProcessorAndObjectMapper(Object object,
            String index, String type) {
        sendWithBulkProcessorAndObjectMapper(object, index, type, null);
    }
877522
public <T extends DataSource> FutureData<ManagedSource> update(String name, T source, ManagedSource id) {
        return update(name, source, id, false);
    }
651488
public int reindex(String sourceIndex, String sourceType, String targetIndex) throws IOException {
        logger.debug("reindex [{}]/[{}] -> [{}]/[doc]", sourceIndex, sourceType, targetIndex);

        String reindexQuery = "{  \"source\": {\n" +
                "    \"index\": \"" + sourceIndex + "\",\n" +
                "    \"type\": \"" + sourceType + "\"\n" +
                "  },\n" +
                "  \"dest\": {\n" +
                "    \"index\": \"" + targetIndex + "\",\n" +
                "    \"type\": \"doc\"\n" +
                "  }\n" +
                "}\n";

        logger.trace("{}", reindexQuery);

        HttpEntity entity = EntityBuilder.create().setText(reindexQuery).setContentType(ContentType.APPLICATION_JSON).build();
        Response restResponse = lowLevelClient.performRequest("POST", "/_reindex", Collections.emptyMap(), entity);
        Map<String, Object> response = asMap(restResponse);
        logger.debug("reindex response: {}", response);

        return (response == null ? -1 : (int) response.get("total"));
    }
64965
public UpdateResponse upsertData(String jsonSource, String index,
            String type, String id) {
        return upsertQuery(buildPrepareUpsert(index, type, id, jsonSource));
    }
1183079
public void sendWithBulkProcessor(Map<String, ?> source, String index,
            String type) {
        sendWithBulkProcessor(source, index, type, null);
    }
586144
public int reindex(String sourceIndex, String sourceType, String targetIndex) throws IOException {
        logger.debug("reindex [{}]/[{}] -> [{}]/[doc]", sourceIndex, sourceType, targetIndex);

        String reindexQuery = "{  \"source\": {\n" +
                "    \"index\": \"" + sourceIndex + "\",\n" +
                "    \"type\": \"" + sourceType + "\"\n" +
                "  },\n" +
                "  \"dest\": {\n" +
                "    \"index\": \"" + targetIndex + "\",\n" +
                "    \"type\": \"doc\"\n" +
                "  }\n" +
                "}\n";

        logger.trace("{}", reindexQuery);

        Request request = new Request("POST", "/_reindex");
        request.setJsonEntity(reindexQuery);

        Response restResponse = client.getLowLevelClient().performRequest(request);
        Map<String, Object> response = asMap(restResponse);
        logger.debug("reindex response: {}", response);

        return (int) response.get("total");
    }
455639
public <T extends MPBase> T getByIndex(int index) {
        T resource = (T) _resourceArray.get(index);
        return resource;
    }
1336329
public Binder insert(int index, Class<?> type, Object value) {
        return new Binder(this, new Insert(index, new Class[]{type}, value));
    }
524428
private static int index(Object o) {
        Integer i = TYPE_INDICES.get(o);
        if (i == null) {
            synchronized (TYPE_INDICES) {
                // check that another thread did not already update the index
                i = TYPE_INDICES.get(o);
                if (i != null)
                    return i;
                else {
                    int j = TYPE_INDICES.size();
                    TYPE_INDICES.put(o, j);
                    TYPES.add(o);
                    return j;
                }
            }
        }
        return i;
    }