private IndexRequest newIndexRequest(IssueDoc issue) { String projectUuid = issue.projectUuid(); return esClient.prepareIndex(INDEX_TYPE_ISSUE) .setId(issue.key()) .setRouting(projectUuid) .setParent(projectUuid) .setSource(issue.getFields()) .request(); }
/** * Adds an {@link IndexRequest} to the list of actions to execute. Follows the same behavior of {@link IndexRequest} * (for example, if no id is provided, one will be generated, or usage of the create flag). */ public BulkRequestBuilder add(IndexRequestBuilder request) { super.request.add(request.request()); return this; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, BulkByScrollResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
/** * Adds an {@link IndexRequest} to the list of actions to execute. Follows the same behavior of {@link IndexRequest} * (for example, if no id is provided, one will be generated, or usage of the create flag). */ public BulkRequestBuilder add(IndexRequestBuilder request) { super.request.add(request.request()); return this; }
/** * Adds an {@link IndexRequest} to the list of actions to execute. Follows the same behavior of {@link IndexRequest} * (for example, if no id is provided, one will be generated, or usage of the create flag). */ public BulkRequestBuilder add(IndexRequestBuilder request) { super.request.add(request.request()); return this; }
/** * Adds an {@link IndexRequest} to the list of actions to execute. Follows the same behavior of {@link IndexRequest} * (for example, if no id is provided, one will be generated, or usage of the create flag). */ public BulkRequestBuilder add(IndexRequestBuilder request) { super.request.add(request.request()); return this; }
/** * Adds an {@link IndexRequest} to the list of actions to execute. Follows the same behavior of {@link IndexRequest} * (for example, if no id is provided, one will be generated, or usage of the create flag). */ public BulkRequestBuilder add(IndexRequestBuilder request) { super.request.add(request.request()); return this; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, BulkByScrollResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, ReindexResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, ReindexResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, BulkByScrollResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
private ReindexRequestBuilder(ElasticsearchClient client, Action<ReindexRequest, BulkByScrollResponse, ReindexRequestBuilder> action, SearchRequestBuilder search, IndexRequestBuilder destination) { super(client, action, search, new ReindexRequest(search.request(), destination.request())); this.destination = destination; }
@Override public void accept(final SearchHit hit) { final IndexRequest index = client .prepareIndex(hit.getIndex(), hit.getType(), hit.getId()) .setSource(hit.getSourceRef(), JSON) .request(); request.get().add(index); }
@Override public void accept(final SearchHit hit) { final IndexRequest index = client .prepareIndex(hit.getIndex(), hit.getType(), hit.getId()) .setSource(hit.getSourceRef(), JSON) .request(); request.get().add(index); }
public void store(HttpArticle article, Map<String, Object> fields) throws IOException { XContentBuilder jsonBuilder = jsonBuilder(); jsonBuilder.startObject(); applyFields(jsonBuilder, article, fields); jsonBuilder.endObject(); IndexRequestBuilder insert = getConnection().getClient() .prepareIndex(getIndex(), getType(), article.getUrl()) .setSource(jsonBuilder); getConnection().getProcessor().add(insert.request()); }
/** Add to bulk an IndexRequest. */ private void esIndex(String index, String type, String id, byte[] json) throws Exception{ if (logger.isDebugEnabled()){ logger.debug("Indexing in ES " + index + ", " + type + ", " + id); } if (logger.isTraceEnabled()){ logger.trace("Json indexed : {}", json); } bulkProcessor.add(client.prepareIndex(index, type, id).setSource(json).request()); }
private IndexRequest newIndexRequest(IssueDoc issue) { String projectUuid = issue.projectUuid(); return esClient.prepareIndex(INDEX_TYPE_ISSUE) .setId(issue.key()) .setRouting(projectUuid) .setParent(projectUuid) .setSource(issue.getFields()) .request(); }
private IndexRequest getPropertyDocumentIndexRequest(IndexInfo indexInfo, Element element, Property property) throws IOException { XContentBuilder jsonBuilder = buildJsonContentFromProperty(indexInfo, property); if (jsonBuilder == null) { return null; } String id = getChildDocId(element, property); //LOGGER.debug(jsonBuilder.string()); IndexRequestBuilder builder = getClient().prepareIndex(indexInfo.getIndexName(), PROPERTY_TYPE, id); builder = builder.setParent(element.getId()); builder = builder.setSource(jsonBuilder); return builder.request(); }
/** Add to bulk an IndexRequest. */ private void esIndex(String index, String type, String id, XContentBuilder xb) throws Exception{ if (logger.isDebugEnabled()){ logger.debug("Indexing in ES " + index + ", " + type + ", " + id); } if (logger.isTraceEnabled()){ logger.trace("Json indexed : {}", xb.string()); } bulkProcessor.add(client.prepareIndex(index, type, id).setSource(xb).request()); }
private IndexRequest getPropertyDocumentIndexRequest(IndexInfo indexInfo, Element element, Property property) throws IOException { XContentBuilder jsonBuilder = buildJsonContentFromProperty(indexInfo, property); if (jsonBuilder == null) { return null; } String id = getChildDocId(element, property); //LOGGER.debug(jsonBuilder.string()); IndexRequestBuilder builder = getClient().prepareIndex(indexInfo.getIndexName(), PROPERTY_TYPE, id); builder = builder.setParent(element.getId()); builder = builder.setSource(jsonBuilder); return builder.request(); }