find-structure.asciidoc 1.8 KB

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