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,
lib/elasticsearch/api/actions/text_structure/test_grok_pattern.rb,
lib/elasticsearch/api/actions/text_structure/find_field_structure.rb,
lib/elasticsearch/api/actions/text_structure/find_message_structure.rb
Instance Method Summary collapse
-
#find_field_structure(arguments = {}) ⇒ Object
Finds the structure of a text field in an index.
-
#find_message_structure(arguments = {}) ⇒ Object
Finds the structure of a list of messages.
-
#find_structure(arguments = {}) ⇒ Object
Finds the structure of a text file.
-
#test_grok_pattern(arguments = {}) ⇒ Object
Tests a Grok pattern on some text.
Instance Method Details
#find_field_structure(arguments = {}) ⇒ Object
Finds the structure of a text field in an index.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch/api/actions/text_structure/find_field_structure.rb', line 45 def find_field_structure(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.find_field_structure' } arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil method = Elasticsearch::API::HTTP_GET path = '_text_structure/find_field_structure' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#find_message_structure(arguments = {}) ⇒ Object
Finds the structure of a list of messages. The messages 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 |
# File 'lib/elasticsearch/api/actions/text_structure/find_message_structure.rb', line 43 def (arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.find_message_structure' } 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_message_structure' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#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 70 71 |
# File 'lib/elasticsearch/api/actions/text_structure/find_structure.rb', line 47 def find_structure(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.find_structure' } 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) payload = if body.is_a? Array Elasticsearch::API::Utils.__bulkify(body) else body end headers.merge!('Content-Type' => 'application/x-ndjson') Elasticsearch::API::Response.new( perform_request(method, path, params, payload, headers, request_opts) ) end |
#test_grok_pattern(arguments = {}) ⇒ Object
Tests a Grok pattern on some text.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/elasticsearch/api/actions/text_structure/test_grok_pattern.rb', line 33 def test_grok_pattern(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.test_grok_pattern' } 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/test_grok_pattern' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |