find-file-structure.asciidoc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --
  2. :api: find-file-structure
  3. :request: FindFileStructureRequest
  4. :response: FindFileStructureResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Find File Structure API
  8. The Find File Structure API can be used to find the structure of a text file
  9. and other information that will be useful to import its contents to an {es}
  10. index. It accepts a +{request}+ object and responds
  11. with a +{response}+ object.
  12. [id="{upid}-{api}-request"]
  13. ==== Find File Structure Request
  14. A sample from the beginning of the file (or the entire file contents if
  15. it's small) must be added to the +{request}+ object using the
  16. `FindFileStructureRequest#setSample` method.
  17. ["source","java",subs="attributes,callouts,macros"]
  18. --------------------------------------------------
  19. include-tagged::{doc-tests-file}[{api}-request]
  20. --------------------------------------------------
  21. <1> Create a new `FindFileStructureRequest` 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 File Structure Response
  35. A +{response}+ contains information about the file 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 `FileStructure` object contains the structure information