put-data-frame-analytics.asciidoc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. [id="{upid}-{api}-query-config"]
  33. ==== SourceConfig
  34. The index and the query from which to collect data.
  35. ["source","java",subs="attributes,callouts,macros"]
  36. --------------------------------------------------
  37. include-tagged::{doc-tests-file}[{api}-source-config]
  38. --------------------------------------------------
  39. <1> Constructing a new DataFrameAnalyticsSource
  40. <2> The source index
  41. <3> The query from which to gather the data. If query is not set, a `match_all` query is used by default.
  42. ===== QueryConfig
  43. The query with which to select data from the source.
  44. ["source","java",subs="attributes,callouts,macros"]
  45. --------------------------------------------------
  46. include-tagged::{doc-tests-file}[{api}-query-config]
  47. --------------------------------------------------
  48. ==== DestinationConfig
  49. The index to which data should be written by the {dataframe-job}.
  50. ["source","java",subs="attributes,callouts,macros"]
  51. --------------------------------------------------
  52. include-tagged::{doc-tests-file}[{api}-dest-config]
  53. --------------------------------------------------
  54. <1> Constructing a new DataFrameAnalyticsDest
  55. <2> The destination index
  56. ==== Analysis
  57. The analysis to be performed.
  58. Currently, only one analysis is supported: +OutlierDetection+.
  59. +OutlierDetection+ analysis can be created in one of two ways:
  60. ["source","java",subs="attributes,callouts,macros"]
  61. --------------------------------------------------
  62. include-tagged::{doc-tests-file}[{api}-analysis-default]
  63. --------------------------------------------------
  64. <1> Constructing a new OutlierDetection object with default strategy to determine outliers
  65. or
  66. ["source","java",subs="attributes,callouts,macros"]
  67. --------------------------------------------------
  68. include-tagged::{doc-tests-file}[{api}-analysis-customized]
  69. --------------------------------------------------
  70. <1> Constructing a new OutlierDetection object
  71. <2> The method used to perform the analysis
  72. <3> Number of neighbors taken into account during analysis
  73. ==== Analyzed fields
  74. FetchContext object containing fields to be included in / excluded from the analysis
  75. ["source","java",subs="attributes,callouts,macros"]
  76. --------------------------------------------------
  77. include-tagged::{doc-tests-file}[{api}-analyzed-fields]
  78. --------------------------------------------------
  79. include::../execution.asciidoc[]
  80. [id="{upid}-{api}-response"]
  81. ==== Response
  82. The returned +{response}+ contains the newly created {dataframe-analytics-config}.
  83. ["source","java",subs="attributes,callouts,macros"]
  84. --------------------------------------------------
  85. include-tagged::{doc-tests-file}[{api}-response]
  86. --------------------------------------------------