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:
Boaz Leskes 2013-10-08 18:18:20 +02:00
parent a04bce96c7
commit 87df522786
6 changed files with 33 additions and 10 deletions

View File

@ -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"
},

View File

@ -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:

View File

@ -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 }

View File

@ -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

View File

@ -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-*"}

View File

@ -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