From 435338e6b9cceeaf43c8ea418249e4706920008a Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Fri, 28 Apr 2017 09:14:53 -0700 Subject: [PATCH] [DOCS] Fix ML API example for elastic/x-pack-elasticsearch#1180 (elastic/x-pack-elasticsearch#1252) Original commit: elastic/x-pack-elasticsearch@5290dd0a89da832a6aa5ce6500b02cc6854fb83b --- docs/en/rest-api/ml/get-category.asciidoc | 31 +++++++++++------------ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/docs/en/rest-api/ml/get-category.asciidoc b/docs/en/rest-api/ml/get-category.asciidoc index a496f315b1a..4f669801fca 100644 --- a/docs/en/rest-api/ml/get-category.asciidoc +++ b/docs/en/rest-api/ml/get-category.asciidoc @@ -26,12 +26,10 @@ about the categories in the results for a job. ===== Request Body -//TBD: Test these properties, since they didn't work on older build. - -`from`:: +`page`:: +`from`::: (integer) Skips the specified number of categories. - -`size`:: +`size`::: (integer) Specifies the maximum number of categories to obtain. @@ -55,16 +53,22 @@ roles provide these privileges. For more information, see ===== Examples -The following example gets category information for the `it_ops_new_logs` job: +The following example gets information about one category for the +`it_ops_new_logs` job: [source,js] -------------------------------------------------- GET _xpack/ml/anomaly_detectors/it_ops_new_logs/results/categories +{ + "page":{ + "size": 1 + } +} -------------------------------------------------- // CONSOLE // TEST[skip:todo] -In this example, the API returns the following information for each category: +In this example, the API returns the following information: [source,js] ---- { @@ -73,18 +77,13 @@ In this example, the API returns the following information for each category: { "job_id": "it_ops_new_logs", "category_id": 1, - "terms": "Actual Transaction Already Voided Reversed hostname - dbserver.acme.com physicalhost esxserver1.acme.com vmhost app1.acme.com", - "regex": ".*?Actual.+?Transaction.+?Already.+?Voided.+?Reversed.+?hostname. - +?dbserver.acme.com.+?physicalhost.+?esxserver1.acme.com.+?vmhost. - +?app1.acme.com.*", + "terms": "Actual Transaction Already Voided Reversed hostname dbserver.acme.com physicalhost esxserver1.acme.com vmhost app1.acme.com", + "regex": ".*?Actual.+?Transaction.+?Already.+?Voided.+?Reversed.+?hostname.+?dbserver.acme.com.+?physicalhost.+?esxserver1.acme.com.+?vmhost.+?app1.acme.com.*", "max_matching_length": 137, "examples": [ - "Actual Transaction Already Voided / Reversed;hostname=dbserver.acme.com; - physicalhost=esxserver1.acme.com;vmhost=app1.acme.com" + "Actual Transaction Already Voided / Reversed;hostname=dbserver.acme.com;physicalhost=esxserver1.acme.com;vmhost=app1.acme.com" ] - }, - ... + } ] } ----