2018-11-23 14:58:05 +08:00
|
|
|
--
|
2021-01-14 21:16:52 +08:00
|
|
|
:api: find-structure
|
|
|
|
:request: FindStructureRequest
|
|
|
|
:response: FindStructureResponse
|
2018-11-23 14:58:05 +08:00
|
|
|
--
|
2019-09-10 23:26:56 +08:00
|
|
|
[role="xpack"]
|
2018-11-23 14:58:05 +08:00
|
|
|
[id="{upid}-{api}"]
|
2021-01-14 21:16:52 +08:00
|
|
|
=== Find structure API
|
2020-10-03 00:42:57 +08:00
|
|
|
|
2021-01-14 21:16:52 +08:00
|
|
|
Determines the structure of text and other information that will be
|
2020-10-03 02:53:49 +08:00
|
|
|
useful to import its contents to an {es} index. It accepts a +{request}+ object
|
|
|
|
and responds with a +{response}+ object.
|
2018-11-23 14:58:05 +08:00
|
|
|
|
|
|
|
[id="{upid}-{api}-request"]
|
2021-01-14 21:16:52 +08:00
|
|
|
==== Find structure request
|
2018-11-23 14:58:05 +08:00
|
|
|
|
2021-01-14 21:16:52 +08:00
|
|
|
A sample of the text to analyze must be added to the +{request}+
|
|
|
|
object using the `FindStructureRequest#setSample` method.
|
2018-11-23 14:58:05 +08:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
|
|
|
--------------------------------------------------
|
2021-01-14 21:16:52 +08:00
|
|
|
<1> Create a new `FindStructureRequest` object
|
2018-11-23 14:58:05 +08:00
|
|
|
<2> Add the contents of `anInterestingFile` to the request
|
|
|
|
|
2020-10-03 02:53:49 +08:00
|
|
|
==== Optional arguments
|
2018-11-23 14:58:05 +08:00
|
|
|
|
2021-01-29 04:50:14 +08:00
|
|
|
The following arguments are optional:
|
2018-11-23 14:58:05 +08:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-request-options]
|
|
|
|
--------------------------------------------------
|
|
|
|
<1> Set the maximum number of lines to sample (the entire sample will be
|
|
|
|
used if it contains fewer lines)
|
|
|
|
<2> Request that an explanation of the analysis be returned in the response
|
|
|
|
|
|
|
|
include::../execution.asciidoc[]
|
|
|
|
|
|
|
|
[id="{upid}-{api}-response"]
|
2021-01-14 21:16:52 +08:00
|
|
|
==== Find structure response
|
2018-11-23 14:58:05 +08:00
|
|
|
|
2021-01-14 21:16:52 +08:00
|
|
|
A +{response}+ contains information about the text structure,
|
2018-11-23 14:58:05 +08:00
|
|
|
as well as mappings and an ingest pipeline that could be used
|
|
|
|
to index the contents into {es}.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
|
|
|
--------------------------------------------------
|
2021-01-14 21:16:52 +08:00
|
|
|
<1> The `TextStructure` object contains the structure information
|