put-data-frame-analytics.asciidoc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. --
  2. :api: put-data-frame-analytics
  3. :request: PutDataFrameAnalyticsRequest
  4. :response: PutDataFrameAnalyticsResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Put Data Frame Analytics API
  8. The Put Data Frame Analytics API is used to create a new {dataframe-analytics-config}.
  9. The API accepts a +{request}+ object as a request and returns a +{response}+.
  10. [id="{upid}-{api}-request"]
  11. ==== Put Data Frame Analytics Request
  12. A +{request}+ requires the following argument:
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests-file}[{api}-request]
  16. --------------------------------------------------
  17. <1> The configuration of the {dataframe-job} to create
  18. [id="{upid}-{api}-config"]
  19. ==== Data Frame Analytics Configuration
  20. The `DataFrameAnalyticsConfig` object contains all the details about the {dataframe-job}
  21. configuration and contains the following arguments:
  22. ["source","java",subs="attributes,callouts,macros"]
  23. --------------------------------------------------
  24. include-tagged::{doc-tests-file}[{api}-config]
  25. --------------------------------------------------
  26. <1> The {dataframe-analytics-config} id
  27. <2> The source index and query from which to gather data
  28. <3> The destination index
  29. <4> The analysis to be performed
  30. <5> The fields to be included in / excluded from the analysis
  31. <6> The memory limit for the model created as part of the analysis process
  32. <7> Optionally, a human-readable description
  33. [id="{upid}-{api}-query-config"]
  34. ==== SourceConfig
  35. The index and the query from which to collect data.
  36. ["source","java",subs="attributes,callouts,macros"]
  37. --------------------------------------------------
  38. include-tagged::{doc-tests-file}[{api}-source-config]
  39. --------------------------------------------------
  40. <1> Constructing a new DataFrameAnalyticsSource
  41. <2> The source index
  42. <3> The query from which to gather the data. If query is not set, a `match_all` query is used by default.
  43. ===== QueryConfig
  44. The query with which to select data from the source.
  45. ["source","java",subs="attributes,callouts,macros"]
  46. --------------------------------------------------
  47. include-tagged::{doc-tests-file}[{api}-query-config]
  48. --------------------------------------------------
  49. ==== DestinationConfig
  50. The index to which data should be written by the {dataframe-job}.
  51. ["source","java",subs="attributes,callouts,macros"]
  52. --------------------------------------------------
  53. include-tagged::{doc-tests-file}[{api}-dest-config]
  54. --------------------------------------------------
  55. <1> Constructing a new DataFrameAnalyticsDest
  56. <2> The destination index
  57. ==== Analysis
  58. The analysis to be performed.
  59. Currently, only one analysis is supported: +OutlierDetection+.
  60. +OutlierDetection+ analysis can be created in one of two ways:
  61. ["source","java",subs="attributes,callouts,macros"]
  62. --------------------------------------------------
  63. include-tagged::{doc-tests-file}[{api}-analysis-default]
  64. --------------------------------------------------
  65. <1> Constructing a new OutlierDetection object with default strategy to determine outliers
  66. or
  67. ["source","java",subs="attributes,callouts,macros"]
  68. --------------------------------------------------
  69. include-tagged::{doc-tests-file}[{api}-analysis-customized]
  70. --------------------------------------------------
  71. <1> Constructing a new OutlierDetection object
  72. <2> The method used to perform the analysis
  73. <3> Number of neighbors taken into account during analysis
  74. ==== Analyzed fields
  75. FetchContext object containing fields to be included in / excluded from the analysis
  76. ["source","java",subs="attributes,callouts,macros"]
  77. --------------------------------------------------
  78. include-tagged::{doc-tests-file}[{api}-analyzed-fields]
  79. --------------------------------------------------
  80. include::../execution.asciidoc[]
  81. [id="{upid}-{api}-response"]
  82. ==== Response
  83. The returned +{response}+ contains the newly created {dataframe-analytics-config}.
  84. ["source","java",subs="attributes,callouts,macros"]
  85. --------------------------------------------------
  86. include-tagged::{doc-tests-file}[{api}-response]
  87. --------------------------------------------------