Elastic 8.15.0 missing InlineScript

It seems that co.elastic.clients.elasticsearch._types.InlineScript has been removed from 8.15.0 (exists in 8.14.3)?

Is this intended? If so how do I migrate existing code?

		InlineScript inlineScript = InlineScript.of(s -> s
				.source(MY_PLUGIN)
				.lang("langX")
				.params("paramX", jsonData));

Last seen...

Hello,

Until someone more familiar with the Java Elasticsearch client answers, I can confirm that InlineScript got renamed to Script in the Elasticsearch specification to fix an issue with the Go client: [Proposal] Transform script into a container by Anaethelion · Pull Request #2708 · elastic/elasticsearch-specification · GitHub. (The Java Elasticsearch client is generated from that specification.)

I believe renaming InlineScript to Script is all that is needed in your code snippet, as source, lang and params are part of the Script class now.

Sorry for the hassle.

I'm not sure Script and InlineScript are the same, but will try it out...

I removed the Script.of(...) and use the old InlineScript declaration.

		InlineScript inlineScript = InlineScript.of(s -> s
				.source(MY_PLUGIN)
				.lang("langX")
				.params("paramX", jsonData));

		Script script = Script.of(ss -> ss.inline(inlineScript));
		return QueryBuilders.script(q -> q.script(script));

to

		Script script = Script.of(s -> s
				.source(MY_PLUGIN)
				.lang("langX")
				.params("paramX", jsonData));

		return QueryBuilders.script(q -> q.script(script));

I now see errors on the range QueryBuilder...

field(...) does not exist anymore?

Query revTerm = QueryBuilders.range(r -> r.field("rev").to(String.valueOf(rev)));

Perhaps it is now wrapped in a term?

Query revTerm = QueryBuilders.range(r -> r.term(t -> t.field("rev").to(String.valueOf(rev))));

Hello, first of all I can confirm that the old classes InlineScript and StoredScript were simplified to just Script: these were client specific classes that don't exist in the server, so we decided to make these more coherent with the server structure. RangeQuery has been changed to make it possible to specify the type of the query and avoid passing JsonData as argument, you can find an example of the new usage in the release highlights.

Thank you for the clarification and link to the release notes. I need to fully test the changes to range queries, but wrapping with a term seemed to work.