@@ -32,7 +32,7 @@ public void init() throws IOException {
3232 public void test_mandatory_params () {
3333 String query = "SELECT Id FROM " + TEST_INDEX_BEER
3434 + " WHERE multi_match([\\ \" Tags\\ \" ^ 1.5, Title, `Body` 4.2], 'taste')" ;
35- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
35+ JSONObject result = executeJdbcRequest ( query );
3636 assertEquals (16 , result .getInt ("total" ));
3737 }
3838
@@ -44,39 +44,39 @@ public void test_all_params() {
4444 + "fuzziness = 'AUTO:1,5', fuzzy_transpositions = false, lenient = true, max_expansions = 25,"
4545 + "minimum_should_match = '2<-25% 9<-3', prefix_length = 7, tie_breaker = 0.3,"
4646 + "type = most_fields, slop = 2, zero_terms_query = 'ALL');" ;
47- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
47+ JSONObject result = executeJdbcRequest ( query );
4848 assertEquals (10 , result .getInt ("total" ));
4949 }
5050
5151 @ Test
5252 public void verify_wildcard_test () {
5353 String query1 = "SELECT Id FROM " + TEST_INDEX_BEER
5454 + " WHERE multi_match(['Tags'], 'taste')" ;
55- var result1 = new JSONObject ( executeQuery ( query1 , "jdbc" ) );
55+ JSONObject result1 = executeJdbcRequest ( query1 );
5656 String query2 = "SELECT Id FROM " + TEST_INDEX_BEER
5757 + " WHERE multi_match(['T*'], 'taste')" ;
58- var result2 = new JSONObject ( executeQuery ( query2 , "jdbc" ) );
58+ JSONObject result2 = executeJdbcRequest ( query2 );
5959 assertNotEquals (result2 .getInt ("total" ), result1 .getInt ("total" ));
6060
6161 String query = "SELECT Id FROM " + TEST_INDEX_BEER
6262 + " WHERE multi_match(['*Date'], '2014-01-22');" ;
63- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
63+ JSONObject result = executeJdbcRequest ( query );
6464 assertEquals (10 , result .getInt ("total" ));
6565 }
6666
6767 @ Test
6868 public void test_multimatch_alternate_parameter_syntax () {
6969 String query = "SELECT Tags FROM " + TEST_INDEX_BEER
7070 + " WHERE multimatch('query'='taste', 'fields'='Tags')" ;
71- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
71+ JSONObject result = executeJdbcRequest ( query );
7272 assertEquals (8 , result .getInt ("total" ));
7373 }
7474
7575 @ Test
7676 public void test_multimatchquery_alternate_parameter_syntax () {
7777 String query = "SELECT Tags FROM " + TEST_INDEX_BEER
7878 + " WHERE multimatchquery(query='cicerone', fields='Tags')" ;
79- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
79+ JSONObject result = executeJdbcRequest ( query );
8080 assertEquals (2 , result .getInt ("total" ));
8181 verifyDataRows (result , rows ("serving cicerone restaurants" ),
8282 rows ("taste cicerone" ));
@@ -86,7 +86,7 @@ public void test_multimatchquery_alternate_parameter_syntax() {
8686 public void test_quoted_multi_match_alternate_parameter_syntax () {
8787 String query = "SELECT Tags FROM " + TEST_INDEX_BEER
8888 + " WHERE multi_match('query'='cicerone', 'fields'='Tags')" ;
89- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
89+ JSONObject result = executeJdbcRequest ( query );
9090 assertEquals (2 , result .getInt ("total" ));
9191 verifyDataRows (result , rows ("serving cicerone restaurants" ),
9292 rows ("taste cicerone" ));
@@ -96,7 +96,7 @@ public void test_quoted_multi_match_alternate_parameter_syntax() {
9696 public void test_multi_match_alternate_parameter_syntax () {
9797 String query = "SELECT Tags FROM " + TEST_INDEX_BEER
9898 + " WHERE multi_match(query='cicerone', fields='Tags')" ;
99- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
99+ JSONObject result = executeJdbcRequest ( query );
100100 assertEquals (2 , result .getInt ("total" ));
101101 verifyDataRows (result , rows ("serving cicerone restaurants" ),
102102 rows ("taste cicerone" ));
@@ -106,7 +106,7 @@ public void test_multi_match_alternate_parameter_syntax() {
106106 public void test_wildcard_multi_match_alternate_parameter_syntax () {
107107 String query = "SELECT Body FROM " + TEST_INDEX_BEER
108108 + " WHERE multi_match(query='IPA', fields='B*') LIMIT 1" ;
109- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
109+ JSONObject result = executeJdbcRequest ( query );
110110 verifyDataRows (result , rows ("<p>I know what makes an IPA an IPA, but what are the unique" +
111111 " characteristics of it's common variants? To be specific, the ones I'm interested in are Double IPA" +
112112 " and Black IPA, but general differences between any other styles would be welcome too. </p>\n " ));
@@ -121,7 +121,7 @@ public void test_all_params_multimatchquery_alternate_parameter_syntax() {
121121 + "minimum_should_match = '2<-25% 9<-3', prefix_length = 7, tie_breaker = 0.3,"
122122 + "type = most_fields, slop = 2, zero_terms_query = 'ALL');" ;
123123
124- var result = new JSONObject ( executeQuery ( query , "jdbc" ) );
124+ JSONObject result = executeJdbcRequest ( query );
125125 assertEquals (2 , result .getInt ("total" ));
126126 }
127127}
0 commit comments