Skip to content

Commit 2df0362

Browse files
author
Christoph Büscher
committed
Add additional fields API tests (#68897)
This change adds tests around the handling of mixed object and dot notation in document source when using the `fields` API with nested fields left out of #67432. After merging #68540, this test can now be added. Relates to #67432
1 parent c6a6bc3 commit 2df0362

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/search/330_fetch_fields.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ Test nested field inside object structure:
519519
id: 2
520520
refresh: true
521521
body:
522+
obj:
523+
products:
524+
- { "manufacturer" : "MaxEngine", "base_price" : 11.0, "product_id" : 67890}
522525
obj.products:
523526
- { "manufacturer" : "RealTec", "base_price" : 12.55, "product_id" : 23451}
524527
obj.other_obj_field: other_value2
@@ -538,7 +541,9 @@ Test nested field inside object structure:
538541
- match:
539542
hits.hits.0.fields.obj\.other_obj_field.0: other_value
540543
- match:
541-
hits.hits.1.fields.obj\.products.0: { "manufacturer" : ["RealTec"], "base_price" : [12.55], "product_id" : [23451]}
544+
hits.hits.1.fields.obj\.products.0: { "manufacturer" : ["MaxEngine"], "base_price" : [11.0], "product_id" : [67890]}
545+
- match:
546+
hits.hits.1.fields.obj\.products.1: { "manufacturer" : ["RealTec"], "base_price" : [12.55], "product_id" : [23451]}
542547
- match:
543548
hits.hits.1.fields.obj\.other_obj_field.0: other_value2
544549

@@ -562,7 +567,9 @@ Test nested field inside object structure:
562567
- match:
563568
hits.hits.0.fields.obj\.products.1: { "manufacturer" : ["HyperSmart"]}
564569
- match:
565-
hits.hits.1.fields.obj\.products.0: { "manufacturer" : ["RealTec"]}
570+
hits.hits.1.fields.obj\.products.0: { "manufacturer" : ["MaxEngine"]}
571+
- match:
572+
hits.hits.1.fields.obj\.products.1: { "manufacturer" : ["RealTec"]}
566573

567574
- do:
568575
search:
@@ -575,7 +582,9 @@ Test nested field inside object structure:
575582
- match:
576583
hits.hits.0.fields.obj\.products.1: { "manufacturer" : ["HyperSmart"]}
577584
- match:
578-
hits.hits.1.fields.obj\.products.0: { "manufacturer" : ["RealTec"]}
585+
hits.hits.1.fields.obj\.products.0: { "manufacturer" : ["MaxEngine"]}
586+
- match:
587+
hits.hits.1.fields.obj\.products.1: { "manufacturer" : ["RealTec"]}
579588
---
580589
Test doubly nested fields:
581590
- skip:

0 commit comments

Comments
 (0)