@@ -987,7 +987,7 @@ def test_create_json_index(self):
987987 'reduce' : '_count' ,
988988 'options' : {'def' : {'fields' : ['name' ,
989989 'age' ]},
990- 'w' : 2 }}}}
990+ }}}}
991991 )
992992
993993 def test_create_text_index (self ):
@@ -1078,7 +1078,7 @@ def test_create_multiple_indexes_one_ddoc(self):
10781078 'reduce' : '_count' ,
10791079 'options' : {'def' : {'fields' : ['name' ,
10801080 'age' ]},
1081- 'w' : 2 }}},
1081+ }}},
10821082 'indexes' : {'text-index-001' : {
10831083 'index' : {'index_array_lengths' : True ,
10841084 'fields' : [{'name' : 'name' , 'type' : 'string' },
@@ -1175,7 +1175,8 @@ def test_get_query_indexes_raw(self):
11751175 'default_field' : {},
11761176 'default_analyzer' : 'keyword' ,
11771177 'selector' : {}}}
1178- ]}
1178+ ],
1179+ 'total_rows' : 3 }
11791180 )
11801181
11811182 def test_get_query_indexes (self ):
@@ -1217,7 +1218,7 @@ def test_get_search_result_with_invalid_value_types(self):
12171218 {'drilldown' : 'blah' }, # Should be a list
12181219 {'group_field' : ['blah' ]}, # Should be a STRTYPE
12191220 {'group_limit' : 'int' }, # Should be an int
1220- {'group_sort' : 'blah' }, # Should be a list
1221+ {'group_sort' : 3 }, # Should be a STRTYPE or list
12211222 {'include_docs' : 'blah' }, # Should be a boolean
12221223 {'limit' : 'blah' }, # Should be an int
12231224 {'ranges' : 1 }, # Should be a dict
@@ -1278,6 +1279,7 @@ def test_get_search_result_executes_search_query(self):
12781279 'searchddoc001' ,
12791280 'searchindex001' ,
12801281 query = 'julia*' ,
1282+ sort = '_id<string>' ,
12811283 limit = 5 ,
12821284 include_docs = True
12831285 )
@@ -1292,23 +1294,23 @@ def test_get_search_result_executes_search_query(self):
12921294 {'rows' : [{'fields' : {'name' : 'julia' }, 'doc' : {'_id' : 'julia000' ,
12931295 'age' : 0 ,
12941296 'name' : 'julia' },
1295- 'id' : 'julia000' , 'order' : [1.0 , 0 ]},
1297+ 'id' : 'julia000' , 'order' : ['julia000' , 0 ]},
12961298 {'fields' : {'name' : 'julia' }, 'doc' : {'_id' : 'julia001' ,
12971299 'age' : 1 ,
12981300 'name' : 'julia' },
1299- 'id' : 'julia001' , 'order' : [1.0 , 0 ]},
1301+ 'id' : 'julia001' , 'order' : ['julia001' , 0 ]},
13001302 {'fields' : {'name' : 'julia' },'doc' : {'_id' : 'julia002' ,
13011303 'age' : 2 ,
13021304 'name' : 'julia' },
1303- 'id' : 'julia002' , 'order' : [1.0 , 0 ]},
1304- {'fields' : {'name' : 'julia' }, 'doc' : {'_id' : 'julia004 ' ,
1305- 'age' : 4 ,
1305+ 'id' : 'julia002' , 'order' : ['julia002' , 0 ]},
1306+ {'fields' : {'name' : 'julia' }, 'doc' : {'_id' : 'julia003 ' ,
1307+ 'age' : 3 ,
13061308 'name' : 'julia' },
1307- 'id' : 'julia004 ' , 'order' : [1.0 , 1 ]},
1309+ 'id' : 'julia003 ' , 'order' : ['julia003' , 0 ]},
13081310 {'fields' : {'name' : 'julia' },
1309- 'doc' : {'_id' : 'julia005 ' , 'age' : 5 ,
1311+ 'doc' : {'_id' : 'julia004 ' , 'age' : 4 ,
13101312 'name' : 'julia' },
1311- 'id' : 'julia005 ' , 'order' : [1.0 , 1 ]}], 'total_rows' : 100 }
1313+ 'id' : 'julia004 ' , 'order' : ['julia004' , 1 ]}], 'total_rows' : 100 }
13121314 )
13131315
13141316 def test_get_search_result_executes_search_query_with_group_option (self ):
@@ -1322,7 +1324,8 @@ def test_get_search_result_executes_search_query_with_group_option(self):
13221324 'searchindex001' ,
13231325 query = 'name:julia*' ,
13241326 group_field = '_id' ,
1325- group_limit = 5
1327+ group_limit = 5 ,
1328+ group_sort = '_id<string>'
13261329 )
13271330 # for group parameter options, 'rows' results are within 'groups' key
13281331 self .assertEqual (len (resp ['groups' ]), 5 )
@@ -1332,18 +1335,18 @@ def test_get_search_result_executes_search_query_with_group_option(self):
13321335 {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia000' ,
13331336 'order' : [1.0 , 0 ]}], 'total_rows' : 1 ,
13341337 'by' : 'julia000' },
1338+ {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia001' ,
1339+ 'order' : [1.0 , 0 ]}], 'total_rows' : 1 ,
1340+ 'by' : 'julia001' },
1341+ {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia002' ,
1342+ 'order' : [1.0 , 0 ]}], 'total_rows' : 1 ,
1343+ 'by' : 'julia002' },
1344+ {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia003' ,
1345+ 'order' : [1.0 , 0 ]}], 'total_rows' : 1 ,
1346+ 'by' : 'julia003' },
13351347 {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia004' ,
13361348 'order' : [1.0 , 1 ]}], 'total_rows' : 1 ,
1337- 'by' : 'julia004' },
1338- {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia008' ,
1339- 'order' : [1.0 , 2 ]}], 'total_rows' : 1 ,
1340- 'by' : 'julia008' },
1341- {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia010' ,
1342- 'order' : [1.0 , 3 ]}], 'total_rows' : 1 ,
1343- 'by' : 'julia010' },
1344- {'rows' : [{'fields' : {'name' : 'julia' }, 'id' : 'julia014' ,
1345- 'order' : [1.0 , 4 ]}], 'total_rows' : 1 ,
1346- 'by' : 'julia014' }
1349+ 'by' : 'julia004' }
13471350 ]}
13481351 )
13491352
0 commit comments