updated source filtering tests and spec
Fixed id tests to be strings. Changed the _source_* param of get_source as they have changed in core.
This commit is contained in:
parent
a04bce96c7
commit
87df522786
|
@ -24,11 +24,11 @@
|
|||
}
|
||||
},
|
||||
"params": {
|
||||
"_source_exclude": {
|
||||
"exclude": {
|
||||
"type" : "list",
|
||||
"description" : "A list of fields to exclude from the returned _source field"
|
||||
},
|
||||
"_source_include": {
|
||||
"include": {
|
||||
"type" : "list",
|
||||
"description" : "A list of fields to extract and return from the _source field"
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
explain: { index: test_1, type: test, id: 1, _source: false, body: { query: { match_all: {}} } }
|
||||
- match: { _index: test_1 }
|
||||
- match: { _type: test }
|
||||
- match: { _id: 1 }
|
||||
- match: { _id: "1" }
|
||||
- is_false: get._source
|
||||
|
||||
- do:
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
- match: { _index: test_1 }
|
||||
- match: { _type: test }
|
||||
- match: { _id: 1 }
|
||||
- match: { _id: "1" }
|
||||
- is_false: _source
|
||||
|
||||
- do:
|
||||
|
@ -55,6 +55,6 @@
|
|||
|
||||
- match: { _index: test_1 }
|
||||
- match: { _type: test }
|
||||
- match: { _id: 1 }
|
||||
- match: { _id: "1" }
|
||||
- match: { fields.count: 1 }
|
||||
- match: { _source.include.field1: v1 }
|
||||
|
|
|
@ -12,18 +12,18 @@
|
|||
body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 }
|
||||
|
||||
- do:
|
||||
get_source: { index: test_1, type: test, id: 1, _source_include: include.field1 }
|
||||
get_source: { index: test_1, type: test, id: 1, include: include.field1 }
|
||||
- match: { include.field1: v1 }
|
||||
- is_false: include.field2
|
||||
|
||||
- do:
|
||||
get_source: { index: test_1, type: test, id: 1, _source_include: "include.field1,include.field2" }
|
||||
get_source: { index: test_1, type: test, id: 1, include: "include.field1,include.field2" }
|
||||
- match: { include.field1: v1 }
|
||||
- match: { include.field2: v2 }
|
||||
- is_false: count
|
||||
|
||||
- do:
|
||||
get_source: { index: test_1, type: test, id: 1, _source_include: include, _source_exclude: "*.field2" }
|
||||
get_source: { index: test_1, type: test, id: 1, include: include, exclude: "*.field2" }
|
||||
- match: { include.field1: v1 }
|
||||
- is_false: include.field2
|
||||
- is_false: count
|
||||
|
|
|
@ -15,3 +15,26 @@
|
|||
|
||||
- match: {test.template: "test-*"}
|
||||
- match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}}
|
||||
---
|
||||
"Get all templates":
|
||||
- do:
|
||||
indices.put_template:
|
||||
name: test
|
||||
body:
|
||||
template: test-*
|
||||
settings:
|
||||
number_of_shards: 1
|
||||
- do:
|
||||
indices.put_template:
|
||||
name: test2
|
||||
body:
|
||||
template: test2-*
|
||||
settings:
|
||||
number_of_shards: 1
|
||||
|
||||
- do:
|
||||
indices.get_template: {}
|
||||
|
||||
- match: {test.template: "test-*"}
|
||||
- match: {test2.template: "test2-*"}
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
]
|
||||
}
|
||||
|
||||
- match: { docs.0._id: 1 }
|
||||
- match: { docs.0._id: "1" }
|
||||
- is_false: docs.0._source
|
||||
- match: { docs.1._id: 2 }
|
||||
- match: { docs.1._id: "2" }
|
||||
- is_true: docs.1._source
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue