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
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.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/elasticsearch/api/actions/text_structure/find_structure.rb', line 43 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 |