Browse Source

[TEST] fix test to use a dedicated index to ensure lucene docIDs are guaranteed

Simon Willnauer 7 năm trước cách đây
mục cha
commit
7957c9751c

+ 4 - 2
modules/lang-mustache/src/test/resources/rest-api-spec/test/lang_mustache/30_search_template.yml

@@ -78,9 +78,11 @@
         id:     4
         body:   { "theField": "foo 4" }
 
+  # we use a different index here since we compare the explain description which contains a doc ID and we can only be sure that it's 0
+  # if we are the only doc in the shard.
   - do:
       index:
-        index:  test
+        index:  otherindex
         type:   type
         id:     5
         body:   { "otherField": "foo" }
@@ -113,7 +115,7 @@
 
   - match: { hits.total: 1 }
   - length: { hits.hits: 1 }
-  - match: { hits.hits.0._explanation.description: "weight(otherField:foo in 1) [PerFieldSimilarity], result of:" }
+  - match: { hits.hits.0._explanation.description: "weight(otherField:foo in 0) [PerFieldSimilarity], result of:" }
 
   - do:
       search_template: