Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions docs/plugins/mapper-size.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,49 @@ GET my_index/_search
{
"query": {
"range": {
"_size": { <1>
"_size": { <1>
"gt": 10
}
}
},
"aggs": {
"sizes": {
"terms": {
"field": "_size", <2>
"field": "_size", <2>
"size": 10
}
}
},
"sort": [
{
"_size": { <3>
"_size": { <3>
"order": "desc"
}
}
],
"script_fields": {
"size": {
"script": "doc['_size']" <4>
"script": "doc['_size']" <4>
}
}
},
"docvalue_fields": [
{
"field": "_size" <5>
}
]
}
--------------------------
// TEST[continued]

<1> Querying on the `_size` field
<2> Aggregating on the `_size` field
<3> Sorting on the `_size` field
<4> Accessing the `_size` field in scripts (inline scripts must be modules-security-scripting.html#enable-dynamic-scripting[enabled] for this example to work)
<4> Uses a
{ref}/search-request-body.html#request-body-search-script-fields[script field]
to return the `_size` field in the search response.
<5> Uses a
{ref}/search-request-body.html#request-body-search-docvalue-fields[doc value
field] to return the `_size` field in the search response. Doc value fields are
useful if
{ref}/modules-scripting-security.html#allowed-script-types-setting[inline
scripts are disabled].