Documentation: Repleace search_type=count with size=0 in the docs

Relates elastic/elasticsearch#787

Original commit: elastic/x-pack-elasticsearch@f0183cedc3
This commit is contained in:
Alexander Reelsen 2015-10-13 15:46:27 +02:00
parent 28948f8930
commit b95101f7a0
9 changed files with 19 additions and 19 deletions

View File

@ -93,7 +93,7 @@ time range.
[source,js]
--------------------------------------------------
GET .watch_history*/_search?search_type=count
GET .watch_history*/_search?size=0
{
"query": {
"filtered": {

View File

@ -56,8 +56,8 @@ For example, the following search input searches the watch history indices for w
"indices": [
".watch_history*"
],
"search_type": "count",
"body": {
"size" : 0,
"query" : {
"filtered": {
"query" : {
@ -293,4 +293,4 @@ the following webhook action creates a Pagerduty trigger event.
}
}
}
--------------------------------------------------
--------------------------------------------------

View File

@ -163,8 +163,8 @@ PUT _watcher/watch/mem_watch
"indices": [
".marvel-*"
],
"search_type": "count",
"body": {
"size" : 0,
"query": {
"filtered": {
"filter": {
@ -264,8 +264,8 @@ PUT _watcher/watch/cpu_usage
"indices": [
".marvel-*"
],
"search_type": "count",
"body": {
"size" : 0,
"query": {
"filtered": {
"filter": {
@ -374,9 +374,9 @@ PUT _watcher/watch/open_file_descriptors
".marvel-*"
],
"types": "node_stats",
"search_type": "count",
"body": {
"query": {
"size" : 0,
"filtered": {
"filter": {
"range": {
@ -483,9 +483,9 @@ PUT _watcher/watch/fielddata_utilization
".marvel-*"
],
"types": "node_stats",
"search_type": "count",
"body": {
"query": {
"size" : 0,
"filtered": {
"filter": {
"range": {
@ -661,4 +661,4 @@ PUT _watcher/watch/node_event
NOTE: This example uses an inline script, which requires you to enable dynamic scripting in
Elasticsearch. While this is convenient when you're experimenting with Watcher, in a
production environment we recommend disabling dynamic scripting and using file scripts.
production environment we recommend disabling dynamic scripting and using file scripts.

View File

@ -53,9 +53,9 @@ PUT _watcher/watch/log_event_watch
"input" : { <3>
"search" : {
"request" : {
"search_type" : "count",
"indices" : "log-events",
"body" : {
"size" : 0,
"query" : { "match" : { "status" : "error" } }
}
}

View File

@ -51,9 +51,9 @@ PUT _watcher/watch/log_event_watch
"input" : {
"search" : {
"request" : {
"search_type" : "count",
"indices" : "log-events",
"body" : {
"size" : 0,
"query" : { "match" : { "status" : "error" } }
}
}
@ -172,4 +172,4 @@ include::actions/logging.asciidoc[]
include::actions/hipchat.asciidoc[]
include::actions/slack.asciidoc[]
include::actions/slack.asciidoc[]

View File

@ -133,9 +133,9 @@ and uses a `script` condition to check if the number of hits is above a specifie
{
"input" : {
"search" : {
"search_type" : "count",
"indices" : "log-events",
"body" : {
"size" : 0,
"query" : { "match" : { "status" : "error" } }
}
}

View File

@ -18,7 +18,7 @@ example, to get the message field from the first hit, use `ctx.payload.hits.hits
[options="header"]
|======
| Name |Required | Default | Description
| `request.search_type` | no | count | The {ref}/search-request-search-type.html#search-request-search-type[type] of search request to perform. Valid values are: `count`, `dfs_query_and_fetch`, `dfs_query_then_fetch`, `query_and_fetch`, `query_then_fetch`, and `scan`. The Elasticsearch default is `query_then_fetch`.
| `request.search_type` | no | `query_then_fetch` | The {ref}/search-request-search-type.html#search-request-search-type[type] of search request to perform. Valid values are: `dfs_query_and_fetch`, `dfs_query_then_fetch`, `query_and_fetch`, `query_then_fetch`, and `scan`. The Elasticsearch default is `query_then_fetch`.
| `request.indices` | no | - | The indices to search. If omitted, all indices are searched, which is the default behaviour in Elasticsearch.
| `request.types` | no | - | The document types to search for. If omitted, all document types are are searched, which is the default behaviour in Elasticsearch.
| `request.body` | no | - | The body of the request. The {ref}/search-request-body.html[request body] follows the same structure you normally send in the body of a REST `_search` request. The body can be static text or include `mustache` <<templates, templates>>.

View File

@ -16,9 +16,9 @@ as shown in the following snippet:
"chain" : [ <1>
{
"search" : { <2>
"search_type" : "count",
"indices" : [ "logstash-*" ],
"body" : {
"size" : 0,
"query" : {
"match" : { "priority" : "error" }
}
@ -40,4 +40,4 @@ This example executes a `count` search on the cluster to look for `error` events
search results are then passed to the second `script` transform. The `script` transform
extracts the total hit count and assigns it to the `error_count` field in a newly-generated payload.
This newly-generated payload is the output of the `chain` transform and replaces the
payload in the watch execution context.
payload in the watch execution context.

View File

@ -32,9 +32,9 @@ additional parameters:
"transform" : {
"search" : {
"request" : {
"search_type" : "count",
"indices" : [ "logstash-*" ],
"body" : {
"size" : 0,
"query" : {
"match" : { "priority" : "error"}
}
@ -81,10 +81,10 @@ The following snippet shows an example of a search that refers to the scheduled
{
"transform" : {
"search" : {
"search_type" : "count",
"index" : [ "logstash-*" ],
"type" : "event",
"body" : {
"size" : 0,
"query" : {
"filtered" : {
"filter" : {
@ -123,10 +123,10 @@ The model of the template (based on which the mustache template will be evaluate
{
"transform" : {
"search" : {
"search_type" : "count",
"index" : [ "logstash-*" ],
"type" : "event",
"body" : {
"size" : 0,
"template" {
"inline" : {
"query" : {
@ -161,4 +161,4 @@ The model of the template (based on which the mustache template will be evaluate
}
}
}
--------------------------------------------------
--------------------------------------------------