find-structure.asciidoc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --
  2. :api: find-structure
  3. :request: FindStructureRequest
  4. :response: FindStructureResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Find structure API
  9. experimental::[]
  10. Determines the structure of text and other information that will be
  11. useful to import its contents to an {es} index. It accepts a +{request}+ object
  12. and responds with a +{response}+ object.
  13. [id="{upid}-{api}-request"]
  14. ==== Find structure request
  15. A sample of the text to analyze must be added to the +{request}+
  16. object using the `FindStructureRequest#setSample` method.
  17. ["source","java",subs="attributes,callouts,macros"]
  18. --------------------------------------------------
  19. include-tagged::{doc-tests-file}[{api}-request]
  20. --------------------------------------------------
  21. <1> Create a new `FindStructureRequest` object
  22. <2> Add the contents of `anInterestingFile` to the request
  23. ==== Optional arguments
  24. The following arguments are optional.
  25. ["source","java",subs="attributes,callouts,macros"]
  26. --------------------------------------------------
  27. include-tagged::{doc-tests-file}[{api}-request-options]
  28. --------------------------------------------------
  29. <1> Set the maximum number of lines to sample (the entire sample will be
  30. used if it contains fewer lines)
  31. <2> Request that an explanation of the analysis be returned in the response
  32. include::../execution.asciidoc[]
  33. [id="{upid}-{api}-response"]
  34. ==== Find structure response
  35. A +{response}+ contains information about the text structure,
  36. as well as mappings and an ingest pipeline that could be used
  37. to index the contents into {es}.
  38. ["source","java",subs="attributes,callouts,macros"]
  39. --------------------------------------------------
  40. include-tagged::{doc-tests-file}[{api}-response]
  41. --------------------------------------------------
  42. <1> The `TextStructure` object contains the structure information