Skip to content

After upgrading to the latest version 6.0.0, I cannot use stored scripts in UpdateQuery #3205

@dimitra-konstantinidou

Description

@dimitra-konstantinidou

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

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions