@@ -99,7 +99,7 @@ private JSONObject search(String query, long indexGen, String sortField, boolean
99
99
if (sortField != null ) {
100
100
JSONObject sort = new JSONObject ();
101
101
o .put ("sort" , sort );
102
- sort .put ("doDocScores" , true );
102
+ // sort.put("doDocScores", true);
103
103
104
104
JSONArray sortFields = new JSONArray ();
105
105
sort .put ("fields" , sortFields );
@@ -150,7 +150,7 @@ public void testNumericSort() throws Exception {
150
150
addDocument (0 , "Lisa" , "this is a test" , 10.99f , "2012/10/1" );
151
151
long gen = addDocument (1 , "Tom" , "this is also a test" , 14.99f , "2012/11/3" );
152
152
JSONObject o = search ("test" , gen , "price" , false , true , null , null );
153
- assertEquals (2 , (( Number ) o . get ( "totalHits.value" )). intValue ( ));
153
+ assertEquals (2 , getInt ( o , "totalHits.value" ));
154
154
JSONArray hits = (JSONArray ) o .get ("hits" );
155
155
assertEquals (2 , hits .size ());
156
156
@@ -166,7 +166,7 @@ public void testReverseNumericSort() throws Exception {
166
166
addDocument (0 , "Frank" , "this is a test" , 10.99f , "2012/10/1" );
167
167
long gen = addDocument (1 , "Lisa" , "this is also a test" , 14.99f , "2012/11/3" );
168
168
JSONObject o = search ("test" , gen , "price" , true , true , null , null );
169
- assertEquals (2 , (( Number ) o . get ( "totalHits.value" )). intValue ( ));
169
+ assertEquals (2 , getInt ( o , "totalHits.value" ));
170
170
171
171
JSONArray hits = (JSONArray ) o .get ("hits" );
172
172
assertEquals (2 , hits .size ());
@@ -183,13 +183,13 @@ public void testPrevSearchState() throws Exception {
183
183
long gen = addDocument (0 , "Tom" , "this is a test. here is a random sentence. here is another sentence with test in it." , 10.99f , "2012/10/17" );
184
184
185
185
JSONObject o = search ("test" , gen , null , false , false , null , null );
186
- assertEquals (1 , (( Number ) o . get ( "totalHits.value" )). intValue ( ));
186
+ assertEquals (1 , getInt ( o , "totalHits.value" ));
187
187
188
188
// Add another document
189
189
gen = addDocument (0 , "Melanie" , "this is a test. here is a random sentence. here is another sentence with test in it." , 10.99f , "2012/10/17" );
190
190
191
191
JSONObject o2 = search ("test" , gen , null , false , false , null , null );
192
- assertEquals (2 , (( Number ) o2 . get ( "totalHits.value" )). intValue ( ));
192
+ assertEquals (2 , getInt ( o2 , "totalHits.value" ));
193
193
194
194
// Now the first search does a follow-on search, so we
195
195
// should only see 1 document since it should be using
@@ -201,7 +201,7 @@ public void testPrevSearchState() throws Exception {
201
201
//System.out.println("send: " + o3);
202
202
JSONObject o4 = send ("search" , o3 );
203
203
204
- assertEquals (1 , (( Number ) o4 . get ( "totalHits.value" )). intValue ( ));
204
+ assertEquals (1 , getInt ( o4 , "totalHits.value" ));
205
205
}
206
206
207
207
public void testInvalidFields () throws Exception {
@@ -362,7 +362,7 @@ public void testServerRestart() throws Exception {
362
362
bounceServer ();
363
363
send ("startIndex" );
364
364
JSONObject o = search ("test" , 0 , null , false , true , null , null );
365
- assertEquals (1 , (( Number ) o . get ( "totalHits.value" )). intValue ( ));
365
+ assertEquals (1 , getInt ( o , "totalHits.value" ));
366
366
}
367
367
368
368
public void testStatsHandler () throws Exception {
0 commit comments