Skip to content

Commit f44fbf4

Browse files
committed
API level test
Signed-off-by: Mikhail Stepura <[email protected]>
1 parent 5f37584 commit f44fbf4

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/search/200_ignore_malformed.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
setup:
33
- do:
44
indices.create:
5-
index: test
5+
index: test
66
body:
77
mappings:
88
properties:
@@ -13,6 +13,19 @@ setup:
1313
my_ip:
1414
type: ip
1515
ignore_malformed: true
16+
- do:
17+
indices.create:
18+
index: index_level_setting
19+
body:
20+
settings:
21+
index.mapping.ignore_malformed: true
22+
mappings:
23+
properties:
24+
my_date:
25+
type: date
26+
ignore_malformed: false
27+
my_ip:
28+
type: ip
1629

1730
- do:
1831
index:
@@ -40,6 +53,7 @@ setup:
4053

4154
- do:
4255
search:
56+
index: test
4357
rest_total_hits_as_int: true
4458
body: { query: { exists: { "field": "_ignored" } } }
4559

@@ -50,6 +64,7 @@ setup:
5064

5165
- do:
5266
search:
67+
index: test
5368
rest_total_hits_as_int: true
5469
body: { query: { term: { "_ignored": "my_date" } } }
5570

@@ -60,6 +75,7 @@ setup:
6075

6176
- do:
6277
search:
78+
index: test
6379
rest_total_hits_as_int: true
6480
body: { query: { terms: { "_ignored": [ "my_date", "my_ip" ] } } }
6581

@@ -70,6 +86,7 @@ setup:
7086

7187
- do:
7288
search:
89+
index: test
7390
rest_total_hits_as_int: true
7491
body: { query: { ids: { "values": [ "3" ] } } }
7592

@@ -81,9 +98,18 @@ setup:
8198

8299
- do:
83100
search:
101+
index: test
84102
rest_total_hits_as_int: true
85103
stored_fields: [ "my_date" ]
86104
body: { query: { ids: { "values": [ "3" ] } } }
87105

88106
- length: { hits.hits: 1 }
89107
- is_true: hits.hits.0._ignored
108+
109+
---
110+
"field-level setting shall override index-level setting":
111+
- do:
112+
catch: /failed to parse field \[my_date\] of type \[date\]/
113+
index:
114+
index: index_level_setting
115+
body: { "my_date": "bar", "my_ip": "quux" }

0 commit comments

Comments
 (0)