Module: Elasticsearch::API::TextStructure::Actions
- Included in:
- TextStructureClient
- Defined in:
- lib/elasticsearch/api/namespace/text_structure.rb,
lib/elasticsearch/api/actions/text_structure/find_structure.rb more...
Instance Method Summary collapse
-
#find_structure(arguments = {}) ⇒ Object
Finds the structure of a text file.
Instance Method Details
permalink #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.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/elasticsearch/api/actions/text_structure/find_structure.rb', line 47 def find_structure(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = "_text_structure/find_structure" params = Utils.process_params(arguments) if body.is_a? Array payload = Elasticsearch::API::Utils.__bulkify(body) else payload = body end headers.merge!("Content-Type" => "application/x-ndjson") Elasticsearch::API::Response.new( perform_request(method, path, params, payload, headers) ) end |