mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
parent
636442700c
commit
24776b2b80
18 changed files with 864 additions and 50 deletions
112
docs/java-rest/high-level/ml/get-influencers.asciidoc
Normal file
112
docs/java-rest/high-level/ml/get-influencers.asciidoc
Normal file
|
@ -0,0 +1,112 @@
|
|||
[[java-rest-high-x-pack-ml-get-influencers]]
|
||||
=== Get Influencers API
|
||||
|
||||
The Get Influencers API retrieves one or more influencer results.
|
||||
It accepts a `GetInfluencersRequest` object and responds
|
||||
with a `GetInfluencersResponse` object.
|
||||
|
||||
[[java-rest-high-x-pack-ml-get-influencers-request]]
|
||||
==== Get Influencers Request
|
||||
|
||||
A `GetInfluencersRequest` object gets created with an existing non-null `jobId`.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-request]
|
||||
--------------------------------------------------
|
||||
<1> Constructing a new request referencing an existing `jobId`
|
||||
|
||||
==== Optional Arguments
|
||||
The following arguments are optional:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-desc]
|
||||
--------------------------------------------------
|
||||
<1> If `true`, the influencers are sorted in descending order. Defaults to `false`.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-end]
|
||||
--------------------------------------------------
|
||||
<1> Influencers with timestamps earlier than this time will be returned.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-exclude-interim]
|
||||
--------------------------------------------------
|
||||
<1> If `true`, interim results will be excluded. Defaults to `false`.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-influencer-score]
|
||||
--------------------------------------------------
|
||||
<1> Influencers with influencer_score greater or equal than this value will be returned.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-page]
|
||||
--------------------------------------------------
|
||||
<1> The page parameters `from` and `size`. `from` specifies the number of influencers to skip.
|
||||
`size` specifies the maximum number of influencers to get. Defaults to `0` and `100` respectively.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-sort]
|
||||
--------------------------------------------------
|
||||
<1> The field to sort influencers on. Defaults to `influencer_score`.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-start]
|
||||
--------------------------------------------------
|
||||
<1> Influencers with timestamps on or after this time will be returned.
|
||||
|
||||
[[java-rest-high-x-pack-ml-get-influencers-execution]]
|
||||
==== Execution
|
||||
|
||||
The request can be executed through the `MachineLearningClient` contained
|
||||
in the `RestHighLevelClient` object, accessed via the `machineLearningClient()` method.
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-execute]
|
||||
--------------------------------------------------
|
||||
|
||||
[[java-rest-high-x-pack-ml-get-influencers-execution-async]]
|
||||
==== Asynchronous Execution
|
||||
|
||||
The request can also be executed asynchronously:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-execute-async]
|
||||
--------------------------------------------------
|
||||
<1> The `GetInfluencersRequest` to execute and the `ActionListener` to use when
|
||||
the execution completes
|
||||
|
||||
The asynchronous method does not block and returns immediately. Once it is
|
||||
completed the `ActionListener` is called back with the `onResponse` method
|
||||
if the execution is successful or the `onFailure` method if the execution
|
||||
failed.
|
||||
|
||||
A typical listener for `GetInfluencersResponse` looks like:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-listener]
|
||||
--------------------------------------------------
|
||||
<1> `onResponse` is called back when the action is completed successfully
|
||||
<2> `onFailure` is called back when some unexpected error occurs
|
||||
|
||||
[[java-rest-high-snapshot-ml-get-influencers-response]]
|
||||
==== Get Influencers Response
|
||||
|
||||
The returned `GetInfluencersResponse` contains the requested influencers:
|
||||
|
||||
["source","java",subs="attributes,callouts,macros"]
|
||||
--------------------------------------------------
|
||||
include-tagged::{doc-tests}/MlClientDocumentationIT.java[x-pack-ml-get-influencers-response]
|
||||
--------------------------------------------------
|
||||
<1> The count of influencers that were matched
|
||||
<2> The influencers retrieved
|
|
@ -220,6 +220,7 @@ The Java High Level REST Client supports the following Machine Learning APIs:
|
|||
* <<java-rest-high-x-pack-ml-get-buckets>>
|
||||
* <<java-rest-high-x-pack-ml-get-overall-buckets>>
|
||||
* <<java-rest-high-x-pack-ml-get-records>>
|
||||
* <<java-rest-high-x-pack-ml-get-influencers>>
|
||||
|
||||
include::ml/put-job.asciidoc[]
|
||||
include::ml/get-job.asciidoc[]
|
||||
|
@ -231,6 +232,7 @@ include::ml/get-job-stats.asciidoc[]
|
|||
include::ml/get-buckets.asciidoc[]
|
||||
include::ml/get-overall-buckets.asciidoc[]
|
||||
include::ml/get-records.asciidoc[]
|
||||
include::ml/get-influencers.asciidoc[]
|
||||
|
||||
== Migration APIs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue