-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
type: bugA general bugA general bug
Milestone
Description
I have defined the UpdateQuery like this:
return UpdateQuery.builder(identifier)
.withParams(paramsMap)
.withScriptName(scriptName)
.withRetryOnConflict(RETRY_ON_CONFLICT)
.withRefreshPolicy(refreshPolicy)
.build();
where scriptName is the name of my stored script but the build method of UpdateQuery contains the following check:
public UpdateQuery build() {
if (this.script == null && this.document == null && this.query == null) {
throw new IllegalArgumentException("either script, document or query must be set");
} else {
return new UpdateQuery(this.id, this.script, this.params, this.document, this.upsert, this.lang, this.routing, this.scriptedUpsert, this.docAsUpsert, this.fetchSource, this.fetchSourceIncludes, this.fetchSourceExcludes, this.ifSeqNo, this.ifPrimaryTerm, this.refreshPolicy, this.retryOnConflict, this.timeout, this.waitForActiveShards, this.query, this.abortOnVersionConflict, this.batchSize, this.maxDocs, this.maxRetries, this.pipeline, this.requestsPerSecond, this.shouldStoreResult, this.slices, this.scriptName, this.indexName);
}
}
If I use in the script property the name of the script, it fails later on when it tries to parse the script. If I only specify a script name it fails with the error "either script, document or query must be set".
Is there another way to define a stored script in UpdateQuery?
Thank you
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug