Browse Source

Adapted search_shards rest test to work with Perl

Because of the way Perl treats numbers, the boost is represented
as 1 instead of 1.0, which caused this test to fail.
Clinton Gormley 8 years ago
parent
commit
01b807f98e

+ 15 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/search_shards/10_basic.yaml

@@ -57,7 +57,10 @@
 
   - length: { shards: 1 }
   - match: { shards.0.0.index: test_index }
-  - match: { indices.test_index: {aliases: [test_alias_filter_1], filter: { term : { field: { value: value1, boost: 1.0}}}}}
+  - match: { indices.test_index.aliases: [test_alias_filter_1] }
+  - match: { indices.test_index.filter.term.field.value: value1 }
+  - lte: { indices.test_index.filter.term.field.boost: 1.0 }
+  - gte: { indices.test_index.filter.term.field.boost: 1.0 }
 
   - do:
       search_shards:
@@ -65,4 +68,14 @@
 
   - length: { shards: 1 }
   - match: { shards.0.0.index: test_index }
-  - match: { indices.test_index: {aliases: [test_alias_filter_1, test_alias_filter_2], filter: { bool: { should : [{ term : { field: { value: value1, boost: 1.0}}}, { term : { field: { value: value2, boost: 1.0}}}], adjust_pure_negative: true, boost: 1.0, disable_coord: false }}}}
+  - match: { indices.test_index.aliases: [test_alias_filter_1, test_alias_filter_2]}
+  - match: { indices.test_index.filter.bool.should.0.term.field.value: value1 }
+  - lte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 }
+  - gte: { indices.test_index.filter.bool.should.0.term.field.boost: 1.0 }
+  - match: { indices.test_index.filter.bool.should.1.term.field.value: value2}
+  - lte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 }
+  - gte: { indices.test_index.filter.bool.should.1.term.field.boost: 1.0 }
+  - match: { indices.test_index.filter.bool.adjust_pure_negative: true}
+  - match: { indices.test_index.filter.bool.disable_coord: false}
+  - lte: { indices.test_index.filter.bool.boost: 1.0 }
+  - gte: { indices.test_index.filter.bool.boost: 1.0 }