Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Nov 12, 2024
1 parent 31a28b8 commit cf7b920
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.opensearch._types.BuiltinScriptLanguage;
import org.opensearch.client.opensearch._types.InlineScript;
import org.opensearch.client.opensearch._types.OpenSearchException;
import org.opensearch.client.opensearch._types.Refresh;
Expand Down Expand Up @@ -340,7 +341,7 @@ public void testBulkUpdateScript() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang("painless")
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue += params.inc")
.params("inc", JsonData.of(1))
.build()
Expand Down Expand Up @@ -374,7 +375,7 @@ public void testBulkUpdateScriptUpsert() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang("painless")
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue += params.inc")
.params("inc", JsonData.of(1))
.build()
Expand Down Expand Up @@ -411,7 +412,7 @@ public void testBulkUpdateScriptedUpsertUpdate() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang("painless")
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue = ctx?._source?.intValue == null ? 7777 : 9999")
.build()
)
Expand Down Expand Up @@ -441,7 +442,7 @@ public void testBulkUpdateScriptedUpsertInsert() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang("painless")
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue = ctx?._source?.intValue == null ? 7777 : 9999")
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.function.Function;
import org.junit.Test;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.opensearch._types.BuiltinScriptLanguage;
import org.opensearch.client.opensearch._types.FieldSort;
import org.opensearch.client.opensearch._types.FieldValue;
import org.opensearch.client.opensearch._types.InlineScript;
Expand Down Expand Up @@ -208,7 +209,7 @@ public void shouldReturnMultiSearchesScriptFields() throws Exception {
new ScriptField.Builder().script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang("painless")
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("doc['quantity'].value + params.inc")
.params("inc", JsonData.of(1))
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static void main(String[] args) {
.script(
sss -> sss.inline(
i -> i.source("knn_score")
.lang("knn")
.lang(l -> l.custom("knn"))
.params("field", JsonData.of("values"))
.params("query_value", JsonData.of(searchVector))
.params("space_type", JsonData.of("cosinesimil"))
Expand Down

0 comments on commit cf7b920

Please sign in to comment.