find-file-structure.asciidoc 1.9 KB

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