# Elastic 8.15.0 missing InlineScript

**URL:** https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [August 13, 2024, 10:03am UTC](https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824 "2024-08-13T10:03:31Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![p4paul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p4paul/32/65034_2.png) [@p4paul](https://discuss.elastic.co/u/p4paul)
#### Post date: [August 13, 2024, 10:03am UTC](https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824/1 "2024-08-13T10:03:31Z")

</div>

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?

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

```

Last seen...

> <https://github.com/elastic/elasticsearch-java/blob/v8.14.3/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/InlineScript.java>

---

<div class="post-metadata">

### Author: ![Quentin\_Pradet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/quentin_pradet/32/94192_2.png) [@Quentin\_Pradet](https://discuss.elastic.co/u/Quentin_Pradet)
#### Post date: [August 13, 2024, 10:11am UTC](https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824/2 "2024-08-13T10:11:53Z")

</div>

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](https://github.com/elastic/elasticsearch-specification/pull/2708). (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](https://github.com/elastic/elasticsearch-java/blob/bf86580a8df8ca943378cebfffd3d1489d8ed063/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java#L64).

Sorry for the hassle.

---

<div class="post-metadata">

### Author: ![p4paul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p4paul/32/65034_2.png) [@p4paul](https://discuss.elastic.co/u/p4paul)
#### Post date: [August 13, 2024, 10:30am UTC](https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824/3 "2024-08-13T10:30:21Z")

</div>

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.

```auto
		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

```auto
		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?

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

```

---

<div class="post-metadata">

### Author: ![p4paul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p4paul/32/65034_2.png) [@p4paul](https://discuss.elastic.co/u/p4paul)
#### Post date: [August 13, 2024, 10:31am UTC](https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824/4 "2024-08-13T10:31:57Z")

</div>

Perhaps it is now wrapped in a term?

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

```

---

<div class="post-metadata">

### Author: ![ltrotta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ltrotta/32/124003_2.png) [@ltrotta](https://discuss.elastic.co/u/ltrotta)
#### Post date: [August 20, 2024, 9:00am UTC](https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824/5 "2024-08-20T09:00:23Z")

</div>

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](https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/release-highlights.html).

---

<div class="post-metadata">

### Author: ![p4paul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/p4paul/32/65034_2.png) [@p4paul](https://discuss.elastic.co/u/p4paul)
#### Post date: [August 20, 2024, 10:40am UTC](https://discuss.elastic.co/t/elastic-8-15-0-missing-inlinescript/364824/6 "2024-08-20T10:40:51Z")

</div>

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.
