/** * Sets whether to perform extra effort to detect noop updates via docAsUpsert. * Defaults to true. */ public UpdateRequestBuilder setDetectNoop(boolean detectNoop) { request.detectNoop(detectNoop); return this; }
docAsUpsert(parser.booleanValue()); } else if ("detect_noop".equals(currentFieldName)) { detectNoop(parser.booleanValue()); } else if ("fields".equals(currentFieldName)) { DEPRECATION_LOGGER.deprecated("Deprecated field [fields] used, expected [_source] instead");
/** * Sets whether to perform extra effort to detect noop updates via docAsUpsert. * Defautls to true. */ public UpdateRequestBuilder setDetectNoop(boolean detectNoop) { request.detectNoop(detectNoop); return this; }
/** * Sets whether to perform extra effort to detect noop updates via docAsUpsert. * Defaults to true. */ public UpdateRequestBuilder setDetectNoop(boolean detectNoop) { request.detectNoop(detectNoop); return this; }
/** * Sets whether to perform extra effort to detect noop updates via docAsUpsert. * Defaults to true. */ public UpdateRequestBuilder setDetectNoop(boolean detectNoop) { request.detectNoop(detectNoop); return this; }
/** * Sets whether to perform extra effort to detect noop updates via docAsUpsert. * Defautls to true. */ public UpdateRequestBuilder setDetectNoop(boolean detectNoop) { request.detectNoop(detectNoop); return this; }
/** * Prepares an update request by converting it into an index or delete request or an update response (no action, in the event of a * noop). */ @SuppressWarnings("unchecked") protected Result prepare(ShardId shardId, UpdateRequest request, final GetResult getResult, LongSupplier nowInMillis) { if (getResult.isExists() == false) { // If the document didn't exist, execute the update request as an upsert return prepareUpsert(shardId, request, getResult, nowInMillis); } else if (getResult.internalSourceRef() == null) { // no source, we can't do anything, throw a failure... throw new DocumentSourceMissingException(shardId, request.type(), request.id()); } else if (request.script() == null && request.doc() != null) { // The request has no script, it is a new doc that should be merged with the old document return prepareUpdateIndexRequest(shardId, request, getResult, request.detectNoop()); } else { // The request has a script (or empty script), execute the script and prepare a new index request return prepareUpdateScriptRequest(shardId, request, getResult, nowInMillis); } }
public void updateElement(Element element, String index, String routing, boolean upsert) throws ExecutionException, InterruptedException { UpdateRequest updateRequest = new UpdateRequest(index, element.label(), element.id().toString()) .doc(propertiesMap(element)).routing(routing); if(upsert) updateRequest.detectNoop(true).docAsUpsert(true); if(bulkRequest != null) bulkRequest.add(updateRequest); else client.update(updateRequest).actionGet(); revision++; }
docAsUpsert(parser.booleanValue()); } else if ("detect_noop".equals(currentFieldName)) { detectNoop(parser.booleanValue()); } else if ("fields".equals(currentFieldName)) { List<Object> fields = null;
docAsUpsert(parser.booleanValue()); } else if ("detect_noop".equals(currentFieldName)) { detectNoop(parser.booleanValue()); } else if ("fields".equals(currentFieldName)) { List<Object> fields = null;
docAsUpsert(parser.booleanValue()); } else if ("detect_noop".equals(currentFieldName)) { detectNoop(parser.booleanValue()); } else if ("fields".equals(currentFieldName)) { List<Object> fields = null;
docAsUpsert(parser.booleanValue()); } else if ("detect_noop".equals(currentFieldName)) { detectNoop(parser.booleanValue()); } else if ("fields".equals(currentFieldName)) { List<String> fields = null;
/** * Prepares an update request by converting it into an index or delete request or an update response (no action, in the event of a * noop). */ @SuppressWarnings("unchecked") protected Result prepare(ShardId shardId, UpdateRequest request, final GetResult getResult, LongSupplier nowInMillis) { if (getResult.isExists() == false) { // If the document didn't exist, execute the update request as an upsert return prepareUpsert(shardId, request, getResult, nowInMillis); } else if (getResult.internalSourceRef() == null) { // no source, we can't do anything, throw a failure... throw new DocumentSourceMissingException(shardId, request.type(), request.id()); } else if (request.script() == null && request.doc() != null) { // The request has no script, it is a new doc that should be merged with the old document return prepareUpdateIndexRequest(shardId, request, getResult, request.detectNoop()); } else { // The request has a script (or empty script), execute the script and prepare a new index request return prepareUpdateScriptRequest(shardId, request, getResult, nowInMillis); } }
/** * Prepares an update request by converting it into an index or delete request or an update response (no action, in the event of a * noop). */ @SuppressWarnings("unchecked") protected Result prepare(ShardId shardId, UpdateRequest request, final GetResult getResult, LongSupplier nowInMillis) { if (getResult.isExists() == false) { // If the document didn't exist, execute the update request as an upsert return prepareUpsert(shardId, request, getResult, nowInMillis); } else if (getResult.internalSourceRef() == null) { // no source, we can't do anything, throw a failure... throw new DocumentSourceMissingException(shardId, request.type(), request.id()); } else if (request.script() == null && request.doc() != null) { // The request has no script, it is a new doc that should be merged with the old document return prepareUpdateIndexRequest(shardId, request, getResult, request.detectNoop()); } else { // The request has a script (or empty script), execute the script and prepare a new index request return prepareUpdateScriptRequest(shardId, request, getResult, nowInMillis); } }
parent = indexRequest.parent(); boolean noop = !XContentHelper.update(updatedSourceAsMap, indexRequest.sourceAsMap(), request.detectNoop()); if (request.detectNoop() && noop) { operation = "none";
parent = indexRequest.parent(); boolean noop = !XContentHelper.update(updatedSourceAsMap, indexRequest.sourceAsMap(), request.detectNoop()); if (request.detectNoop() && noop) { operation = "none";