File tree 1 file changed +51
-0
lines changed 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,57 @@ RangeQuery ra = RangeQuery.of(r -> r
40
40
.relation(RangeRelation.Contains)));
41
41
----
42
42
43
+ * Simplified builder for Script, removing the subclasses Stored and Inline. Example with UpdateRequest:
44
+
45
+ ** Old InlineScript:
46
+ +
47
+ [source,java]
48
+ ----
49
+ UpdateRequest updateRequest = UpdateRequest.of(u -> u
50
+ .script(s -> s
51
+ .inline(i -> i
52
+ .lang(ScriptLanguage.Painless)
53
+ .source("my-script")
54
+ .params(params)
55
+ )
56
+ )
57
+ );
58
+ ----
59
+ ** New Script
60
+ +
61
+ [source,java]
62
+ ----
63
+ UpdateRequest updateRequest = UpdateRequest.of(u -> u
64
+ .script(s -> s
65
+ .lang(ScriptLanguage.Painless)
66
+ .source("my-script")
67
+ .params(params)
68
+ )
69
+ );
70
+ ----
71
+ ** Old StoredScript:
72
+ +
73
+ [source,java]
74
+ ----
75
+ UpdateRequest updateRequest = UpdateRequest.of(u -> u
76
+ .script(s -> s
77
+ .stored(st -> st
78
+ .id("script-id")
79
+ )
80
+ )
81
+ );
82
+ ----
83
+ ** New Script
84
+ +
85
+ [source,java]
86
+ ----
87
+ UpdateRequest updateRequest = UpdateRequest.of(u -> u
88
+ .script(s -> s
89
+ .id("script-id")
90
+ )
91
+ );
92
+ ----
93
+
43
94
[discrete]
44
95
==== Version 8.14
45
96
You can’t perform that action at this time.
0 commit comments