Browse Source

[TEST] improved regular scroll REST test

Added sort clause by field and checked docs returned each time
javanna 11 years ago
parent
commit
07ca08dbed
1 changed files with 6 additions and 3 deletions
  1. 6 3
      rest-api-spec/test/scroll/10_basic.yaml

+ 6 - 3
rest-api-spec/test/scroll/10_basic.yaml

@@ -73,14 +73,14 @@
         index:  test_scroll
         index:  test_scroll
         type:   test
         type:   test
         id:     42
         id:     42
-        body:   { foo: bar }
+        body:   { foo: 1 }
 
 
   - do:
   - do:
       index:
       index:
         index:  test_scroll
         index:  test_scroll
         type:   test
         type:   test
         id:     43
         id:     43
-        body:   { foo: bar }
+        body:   { foo: 2 }
 
 
   - do:
   - do:
       indices.refresh: {}
       indices.refresh: {}
@@ -90,6 +90,7 @@
         index: test_scroll
         index: test_scroll
         size: 1
         size: 1
         scroll: 1m
         scroll: 1m
+        sort: foo
         body:
         body:
           query:
           query:
             match_all: {}
             match_all: {}
@@ -97,13 +98,14 @@
   - set: {_scroll_id: scroll_id}
   - set: {_scroll_id: scroll_id}
   - match: {hits.total:      2    }
   - match: {hits.total:      2    }
   - length: {hits.hits:      1    }
   - length: {hits.hits:      1    }
+  - match: {hits.hits.0._id: "42" }
 
 
   - do:
   - do:
       index:
       index:
         index:  test_scroll
         index:  test_scroll
         type:   test
         type:   test
         id:     44
         id:     44
-        body:   { foo: bar }
+        body:   { foo: 3 }
 
 
   - do:
   - do:
       indices.refresh: {}
       indices.refresh: {}
@@ -115,6 +117,7 @@
 
 
   - match: {hits.total:      2    }
   - match: {hits.total:      2    }
   - length: {hits.hits:      1    }
   - length: {hits.hits:      1    }
+  - match: {hits.hits.0._id: "43" }
 
 
   - do:
   - do:
       scroll:
       scroll: