Skip to content

Commit

Permalink
fix failed tests
Browse files Browse the repository at this point in the history
Signed-off-by: YANGDB <[email protected]>
  • Loading branch information
YANG-DB committed Jan 2, 2024
1 parent 7b2fa89 commit 4e3f53a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

package org.opensearch.sql.ppl;

import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BEER;

import java.io.IOException;
import org.json.JSONObject;
import org.opensearch.rest.RestRequest;

/** Run QueryStringIT tests using http GET request */
Expand All @@ -15,4 +18,14 @@ public void init() throws IOException {
super.init();
this.method = RestRequest.Method.GET;
}

@Override
public void mandatory_params_test() throws IOException {
String query =
"source="
+ TEST_INDEX_BEER
+ " | where query_string(['Tags' ^ 1.5, Title, 'Body' 4.2], 'taste')";
JSONObject result = executeQuery(query);
assertEquals(16, result.getInt("total"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

package org.opensearch.sql.ppl;

import static org.opensearch.sql.legacy.TestsConstants.TEST_INDEX_BEER;

import java.io.IOException;
import org.junit.Test;
import org.opensearch.rest.RestRequest;

/** Run SimpleQueryStringIT tests using http GET request */
Expand All @@ -15,4 +18,15 @@ public void init() throws IOException {
super.init();
this.method = RestRequest.Method.GET;
}

@Test
public void test_simple_query_string() throws IOException {
String query =
"SOURCE="
+ TEST_INDEX_BEER
+ " | WHERE simple_query_string(['Tags' ^ 1.5, Title, 'Body' 4.2], 'taste') |"
+ " fields Id";
var result = executeQuery(query);
assertEquals(16, result.getInt("total"));
}
}

0 comments on commit 4e3f53a

Please sign in to comment.