Module: Elasticsearch::XPack::API::TextStructure::Actions
- Included in:
- TextStructureClient
- Defined in:
- lib/elasticsearch/xpack/api/namespace/text_structure.rb,
lib/elasticsearch/xpack/api/actions/text_structure/find_structure.rb,
lib/elasticsearch/xpack/api/actions/text_structure/params_registry.rb
Defined Under Namespace
Modules: ParamsRegistry
Instance Method Summary collapse
-
#find_structure(arguments = {}) ⇒ Object
Finds the structure of a text file.
Instance Method Details
#find_structure(arguments = {}) ⇒ Object
Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/elasticsearch/xpack/api/actions/text_structure/find_structure.rb', line 44 def find_structure(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] headers = arguments.delete(:headers) || {} arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_text_structure/find_structure" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] if body.is_a? Array payload = Elasticsearch::API::Utils.__bulkify(body) else payload = body end headers = Elasticsearch::API::Utils.ndjson_headers(headers) perform_request(method, path, params, payload, headers).body end |