[API] Added _source,_source_include,_source_exclude to

* explain
* get
* mget
* search
* get_source
This commit is contained in:
Clinton Gormley 2013-09-23 13:23:25 +02:00
parent 653ae20603
commit a78781cdc6
7 changed files with 60 additions and 4 deletions

View File

@ -72,8 +72,20 @@
"source": { "source": {
"type" : "string", "type" : "string",
"description" : "The URL-encoded query definition (instead of using the request body)" "description" : "The URL-encoded query definition (instead of using the request body)"
},
"_source": {
"type" : "list",
"description" : "True or false to return the _source field or not, or a list of fields to return"
},
"_source_exclude": {
"type" : "list",
"description" : "A list of fields to exclude from the returned _source field"
},
"_source_include": {
"type" : "list",
"description" : "A list of fields to extract and return from the _source field"
} }
} },
}, },
"body": { "body": {
"description" : "The query definition using the Query DSL" "description" : "The query definition using the Query DSL"

View File

@ -47,6 +47,18 @@
"routing": { "routing": {
"type" : "string", "type" : "string",
"description" : "Specific routing value" "description" : "Specific routing value"
},
"_source": {
"type" : "list",
"description" : "True or false to return the _source field or not, or a list of fields to return"
},
"_source_exclude": {
"type" : "list",
"description" : "A list of fields to exclude from the returned _source field"
},
"_source_include": {
"type" : "list",
"description" : "A list of fields to extract and return from the _source field"
} }
} }
}, },

View File

@ -24,6 +24,14 @@
} }
}, },
"params": { "params": {
"_source_exclude": {
"type" : "list",
"description" : "A list of fields to exclude from the returned _source field"
},
"_source_include": {
"type" : "list",
"description" : "A list of fields to extract and return from the _source field"
},
"parent": { "parent": {
"type" : "string", "type" : "string",
"description" : "The ID of the parent document" "description" : "The ID of the parent document"

View File

@ -31,6 +31,18 @@
"refresh": { "refresh": {
"type" : "boolean", "type" : "boolean",
"description" : "Refresh the shard containing the document before performing the operation" "description" : "Refresh the shard containing the document before performing the operation"
},
"_source": {
"type" : "list",
"description" : "True or false to return the _source field or not, or a list of fields to return"
},
"_source_exclude": {
"type" : "list",
"description" : "A list of fields to exclude from the returned _source field"
},
"_source_include": {
"type" : "list",
"description" : "A list of fields to extract and return from the _source field"
} }
} }
}, },

View File

@ -98,6 +98,18 @@
"type" : "string", "type" : "string",
"description" : "The URL-encoded request definition using the Query DSL (instead of using request body)" "description" : "The URL-encoded request definition using the Query DSL (instead of using request body)"
}, },
"_source": {
"type" : "list",
"description" : "True or false to return the _source field or not, or a list of fields to return"
},
"_source_exclude": {
"type" : "list",
"description" : "A list of fields to exclude from the returned _source field"
},
"_source_include": {
"type" : "list",
"description" : "A list of fields to extract and return from the _source field"
},
"stats": { "stats": {
"type" : "list", "type" : "list",
"description" : "Specific 'tag' of the request for logging and statistical purposes" "description" : "Specific 'tag' of the request for logging and statistical purposes"

View File

@ -12,18 +12,18 @@
body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 }
- do: - do:
get_source: { index: test_1, type: test, id: 1, include: include.field1 } get_source: { index: test_1, type: test, id: 1, _source_include: include.field1 }
- match: { include.field1: v1 } - match: { include.field1: v1 }
- is_false: include.field2 - is_false: include.field2
- do: - do:
get_source: { index: test_1, type: test, id: 1, include: "include.field1,include.field2" } get_source: { index: test_1, type: test, id: 1, _source_include: "include.field1,include.field2" }
- match: { include.field1: v1 } - match: { include.field1: v1 }
- match: { include.field2: v2 } - match: { include.field2: v2 }
- is_false: count - is_false: count
- do: - do:
get_source: { index: test_1, type: test, id: 1, include: include, exclude: "*.field2" } get_source: { index: test_1, type: test, id: 1, _source_include: include, _source_exclude: "*.field2" }
- match: { include.field1: v1 } - match: { include.field1: v1 }
- is_false: include.field2 - is_false: include.field2
- is_false: count - is_false: count