Skip to content

Commit aba471e

Browse files
committed
add test
1 parent 363143f commit aba471e

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.create/21_synthetic_source_stored.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,55 @@ index param - nested array within array:
411411
- match: { hits.hits.0._source.path.to.some.3.id: [ 1000, 2000 ] }
412412

413413

414+
---
415+
index param - nested array within array - disabled second pass:
416+
- requires:
417+
cluster_features: ["mapper.synthetic_source_keep", "mapper.bwc_workaround_9_0"]
418+
reason: requires tracking ignored source
419+
420+
- do:
421+
indices.create:
422+
index: test
423+
body:
424+
settings:
425+
index:
426+
synthetic_source:
427+
enable_second_doc_parsing_pass: false
428+
mappings:
429+
_source:
430+
mode: synthetic
431+
properties:
432+
name:
433+
type: keyword
434+
path:
435+
properties:
436+
to:
437+
properties:
438+
some:
439+
synthetic_source_keep: arrays
440+
properties:
441+
id:
442+
type: integer
443+
444+
- do:
445+
bulk:
446+
index: test
447+
refresh: true
448+
body:
449+
- '{ "create": { } }'
450+
- '{ "name": "A", "path": [ { "to": [ { "some" : [ { "id": 10 }, { "id": [1, 3, 2] } ] }, { "some": { "id": 100 } } ] }, { "to": { "some": { "id": [1000, 2000] } } } ] }'
451+
- match: { errors: false }
452+
453+
- do:
454+
search:
455+
index: test
456+
sort: name
457+
- match: { hits.hits.0._source.name: A }
458+
- length: { hits.hits.0._source.path.to.some: 2}
459+
- match: { hits.hits.0._source.path.to.some.0.id: 10 }
460+
- match: { hits.hits.0._source.path.to.some.1.id: [ 1, 3, 2] }
461+
462+
414463
---
415464
# 112156
416465
stored field under object with store_array_source:

server/src/main/java/org/elasticsearch/index/IndexSettings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,8 @@ public Iterator<Setting<?>> settings() {
652652
);
653653

654654
public static final Setting<Boolean> SYNTHETIC_SOURCE_SECOND_DOC_PARSING_PASS_SETTING = Setting.boolSetting(
655-
"index.synthetic_source.enable_second_doc_parsing_pass",
656-
false,
655+
"index.synthetic_source.enable_second_doc_parsing_pass",
656+
true,
657657
Property.IndexScope,
658658
Property.Dynamic
659659
);

0 commit comments

Comments
 (0)