opensearch-api 1.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.md +3 -3
  4. data/lib/opensearch/api/actions/benchmark.rb +0 -1
  5. data/lib/opensearch/api/actions/bulk.rb +1 -7
  6. data/lib/opensearch/api/actions/count.rb +1 -6
  7. data/lib/opensearch/api/actions/create.rb +0 -1
  8. data/lib/opensearch/api/actions/delete.rb +1 -8
  9. data/lib/opensearch/api/actions/delete_by_query.rb +1 -8
  10. data/lib/opensearch/api/actions/exists.rb +1 -8
  11. data/lib/opensearch/api/actions/exists_source.rb +1 -8
  12. data/lib/opensearch/api/actions/explain.rb +1 -8
  13. data/lib/opensearch/api/actions/get.rb +1 -8
  14. data/lib/opensearch/api/actions/get_source.rb +1 -8
  15. data/lib/opensearch/api/actions/index.rb +1 -8
  16. data/lib/opensearch/api/actions/indices/create.rb +0 -2
  17. data/lib/opensearch/api/actions/indices/get.rb +0 -2
  18. data/lib/opensearch/api/actions/indices/get_field_mapping.rb +1 -10
  19. data/lib/opensearch/api/actions/indices/get_mapping.rb +1 -10
  20. data/lib/opensearch/api/actions/indices/get_template.rb +0 -2
  21. data/lib/opensearch/api/actions/indices/put_mapping.rb +1 -12
  22. data/lib/opensearch/api/actions/indices/put_template.rb +0 -2
  23. data/lib/opensearch/api/actions/indices/rollover.rb +0 -2
  24. data/lib/opensearch/api/actions/indices/validate_query.rb +1 -6
  25. data/lib/opensearch/api/actions/mget.rb +2 -7
  26. data/lib/opensearch/api/actions/msearch.rb +1 -6
  27. data/lib/opensearch/api/actions/msearch_template.rb +1 -6
  28. data/lib/opensearch/api/actions/mtermvectors.rb +1 -6
  29. data/lib/opensearch/api/actions/search.rb +1 -7
  30. data/lib/opensearch/api/actions/search_template.rb +1 -6
  31. data/lib/opensearch/api/actions/termvectors.rb +1 -8
  32. data/lib/opensearch/api/actions/update.rb +1 -8
  33. data/lib/opensearch/api/actions/update_by_query.rb +1 -8
  34. data/lib/opensearch/api/utils.rb +1 -1
  35. data/lib/opensearch/api/version.rb +1 -1
  36. data/lib/opensearch/api.rb +1 -1
  37. data/opensearch-api.gemspec +0 -1
  38. data/spec/opensearch/api/actions/bulk_spec.rb +10 -21
  39. data/spec/opensearch/api/actions/count_spec.rb +3 -3
  40. data/spec/opensearch/api/actions/create_document_spec.rb +8 -8
  41. data/spec/opensearch/api/actions/delete_by_query_spec.rb +0 -17
  42. data/spec/opensearch/api/actions/delete_document_spec.rb +10 -10
  43. data/spec/opensearch/api/actions/exists_document_spec.rb +10 -10
  44. data/spec/opensearch/api/actions/explain_document_spec.rb +8 -8
  45. data/spec/opensearch/api/actions/get_document_source_spec.rb +6 -6
  46. data/spec/opensearch/api/actions/get_document_spec.rb +8 -8
  47. data/spec/opensearch/api/actions/index_document_spec.rb +12 -12
  48. data/spec/opensearch/api/actions/indices/get_field_mapping_spec.rb +0 -11
  49. data/spec/opensearch/api/actions/indices/get_mapping_spec.rb +5 -16
  50. data/spec/opensearch/api/actions/indices/put_mapping_spec.rb +8 -21
  51. data/spec/opensearch/api/actions/indices/validate_query_spec.rb +0 -10
  52. data/spec/opensearch/api/actions/mget_spec.rb +2 -17
  53. data/spec/opensearch/api/actions/mtermvectors_spec.rb +3 -3
  54. data/spec/opensearch/api/actions/search_spec.rb +5 -16
  55. data/spec/opensearch/api/actions/termvectors_spec.rb +5 -5
  56. data/spec/opensearch/api/actions/update_document_spec.rb +11 -11
  57. data/spec/opensearch/api/utils_spec.rb +1 -8
  58. data.tar.gz.sig +0 -0
  59. metadata +2 -22
  60. metadata.gz.sig +0 -0
  61. data/lib/opensearch/api/actions/indices/exists_type.rb +0 -79
  62. data/lib/opensearch/api/actions/indices/flush_synced.rb +0 -79
  63. data/spec/opensearch/api/actions/indices/exists_type_spec.rb +0 -117
  64. data/spec/opensearch/api/actions/indices/flush_synced_spec.rb +0 -99
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0336e67b1234f2806569282b68533fa183b0f26515a163beb4722f578e949a9c
4
- data.tar.gz: 7ea3c280646f1ac0c0f6c78d691da2b488358f68e0fdb1b5bc6938ccc1ca9b6d
3
+ metadata.gz: 51853db273e9ec1c68dcbc6a9e0f47dec778abf7b3983ff406d45ab2c7a8c6a4
4
+ data.tar.gz: ec3001aa95a793ebe2473b4991cf1b203164627f51fa0bf0317e3b64de6ee92e
5
5
  SHA512:
6
- metadata.gz: 551a4da8e0db3d1e8fffda9d6c030838c996d7f95f5a12f457321eb9bf93f95b950511d99dfb9a2ab1fd216a16e87b86daf2a1cbc08891632c37104898b588e7
7
- data.tar.gz: 1fc1d8e8d80319fc4b51f2d0d6977aa3ea4cb93f917b1060959c054507c5e2165c9ca07534e8d31961cb78de6149b844d664c3349137ea1ef40bac1815221e13
6
+ metadata.gz: 894cc99cd81a9a9e5d3a3960ac3856de63e34efc4798286eb4aa99faff06c68d43974ca53e3f176efa3671c1a7575fbcde67bfff4acdf1f0d657d6135e906763
7
+ data.tar.gz: d9eaab4e5888fec4f1b11686b90d8141f04d5a03b7cc0e0688ea0691c0d7b5b643082059c3fec2d35bc20874e282ad3cbab83e26c1d8c8e6a7e2af641213e666
checksums.yaml.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -47,7 +47,7 @@ require 'opensearch'
47
47
 
48
48
  client = OpenSearch::Client.new(log: true)
49
49
 
50
- client.index(index: 'myindex', type: 'mytype', id: 1, body: { title: 'Test' })
50
+ client.index(index: 'myindex', id: 1, body: { title: 'Test' })
51
51
  # => {"_index"=>"myindex", ... "created"=>true}
52
52
 
53
53
  client.search(index: 'myindex', body: { query: { match: { title: 'test' } } })
@@ -106,7 +106,7 @@ p client.cluster.health
106
106
  # --> GET _cluster/health {}
107
107
  # => "{"cluster_name":"opensearch" ... }"
108
108
 
109
- p client.index index: 'myindex', type: 'mytype', id: 'custom', body: { title: "Indexing from my client" }
109
+ p client.index index: 'myindex', id: 'custom', body: { title: "Indexing from my client" }
110
110
  # --> PUT myindex/mytype/custom {} {:title=>"Indexing from my client"}
111
111
  # => "{"ok":true, ... }"
112
112
  ```
@@ -185,7 +185,7 @@ time rake test:unit
185
185
  time rake test:integration
186
186
  ```
187
187
 
188
- We run the test suite for OpenSearch's Rest API tests. You can read more about this in [the test runner README](https://github.com/opensearch-project/opensearch-ruby/tree/main/api-spec-testing#rest-api-yaml-test-runner).
188
+ We run the test suite for OpenSearch's Rest API tests.
189
189
 
190
190
  The `rest_api` needs the test files from OpenSearch. You can run the rake task to download the test artifacts in the root folder of the project. This task needs a running cluster to determine which version and build hash of OpenSearch to use and test against. `TEST_OPENSEARCH_SERVER=http://localhost:9200 rake opensearch:download_artifacts`. This will download the necessary files used for the integration tests to `./tmp`.
191
191
 
@@ -65,7 +65,6 @@ module OpenSearch
65
65
  #
66
66
  # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
67
67
  # to perform the operation on all indices
68
- # @option arguments [String] :type The name of the document type
69
68
  # @option arguments [Hash] :body The search definition using the Query DSL
70
69
  # @option arguments [Boolean] :verbose Specify whether to return verbose statistics about each iteration
71
70
  # (default: false)
@@ -30,7 +30,6 @@ module OpenSearch
30
30
  # Allows to perform multiple index/update/delete operations in a single request.
31
31
  #
32
32
  # @option arguments [String] :index Default index for items which don't provide one
33
- # @option arguments [String] :type Default document type for items which don't provide one
34
33
  # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
35
34
  # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for)
36
35
  # @option arguments [String] :routing Specific routing value
@@ -54,12 +53,8 @@ module OpenSearch
54
53
 
55
54
  _index = arguments.delete(:index)
56
55
 
57
- _type = arguments.delete(:type)
58
-
59
56
  method = OpenSearch::API::HTTP_POST
60
- path = if _index && _type
61
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_bulk"
62
- elsif _index
57
+ path = if _index
63
58
  "#{Utils.__listify(_index)}/_bulk"
64
59
  else
65
60
  "_bulk"
@@ -85,7 +80,6 @@ module OpenSearch
85
80
  :refresh,
86
81
  :routing,
87
82
  :timeout,
88
- :type,
89
83
  :_source,
90
84
  :_source_excludes,
91
85
  :_source_includes,
@@ -30,7 +30,6 @@ module OpenSearch
30
30
  # Returns number of documents matching a query.
31
31
  #
32
32
  # @option arguments [List] :index A comma-separated list of indices to restrict the results
33
- # @option arguments [List] :type A comma-separated list of types to restrict the results
34
33
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
35
34
  # @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled
36
35
  # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
@@ -61,12 +60,8 @@ module OpenSearch
61
60
 
62
61
  _index = arguments.delete(:index)
63
62
 
64
- _type = arguments.delete(:type)
65
-
66
63
  method = OpenSearch::API::HTTP_POST
67
- path = if _index && _type
68
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_count"
69
- elsif _index
64
+ path = if _index
70
65
  "#{Utils.__listify(_index)}/_count"
71
66
  else
72
67
  "_count"
@@ -33,7 +33,6 @@ module OpenSearch
33
33
  #
34
34
  # @option arguments [String] :id Document ID
35
35
  # @option arguments [String] :index The name of the index
36
- # @option arguments [String] :type The type of the document *Deprecated*
37
36
  # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
38
37
  # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for)
39
38
  # @option arguments [String] :routing Specific routing value
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  #
32
32
  # @option arguments [String] :id The document ID
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [String] :type The type of the document *Deprecated*
35
34
  # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
36
35
  # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for)
37
36
  # @option arguments [String] :routing Specific routing value
@@ -60,14 +59,8 @@ module OpenSearch
60
59
 
61
60
  _index = arguments.delete(:index)
62
61
 
63
- _type = arguments.delete(:type)
64
-
65
62
  method = OpenSearch::API::HTTP_DELETE
66
- path = if _index && _type && _id
67
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
68
- else
69
- "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
70
- end
63
+ path = "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
71
64
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
72
65
 
73
66
  body = nil
@@ -30,7 +30,6 @@ module OpenSearch
30
30
  # Deletes documents matching the provided query.
31
31
  #
32
32
  # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices (*Required*)
33
- # @option arguments [List] :type A comma-separated list of document types to search; leave empty to perform the operation on all types
34
33
  # @option arguments [String] :analyzer The analyzer to use for the query string
35
34
  # @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false)
36
35
  # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR)
@@ -83,14 +82,8 @@ module OpenSearch
83
82
 
84
83
  _index = arguments.delete(:index)
85
84
 
86
- _type = arguments.delete(:type)
87
-
88
85
  method = OpenSearch::API::HTTP_POST
89
- path = if _index && _type
90
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_delete_by_query"
91
- else
92
- "#{Utils.__listify(_index)}/_delete_by_query"
93
- end
86
+ path = "#{Utils.__listify(_index)}/_delete_by_query"
94
87
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
95
88
 
96
89
  body = arguments[:body]
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  #
32
32
  # @option arguments [String] :id The document ID
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [String] :type The type of the document (use `_all` to fetch the first document matching the ID across all types) *Deprecated*
35
34
  # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
36
35
  # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
37
36
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
@@ -62,14 +61,8 @@ module OpenSearch
62
61
 
63
62
  _index = arguments.delete(:index)
64
63
 
65
- _type = arguments.delete(:type)
66
-
67
64
  method = OpenSearch::API::HTTP_HEAD
68
- path = if _index && _type && _id
69
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
70
- else
71
- "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
72
- end
65
+ path = "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
73
66
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
74
67
 
75
68
  body = nil
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  #
32
32
  # @option arguments [String] :id The document ID
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [String] :type The type of the document; deprecated and optional starting with 7.0 *Deprecated*
35
34
  # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
36
35
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
37
36
  # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
@@ -61,14 +60,8 @@ module OpenSearch
61
60
 
62
61
  _index = arguments.delete(:index)
63
62
 
64
- _type = arguments.delete(:type)
65
-
66
63
  method = OpenSearch::API::HTTP_HEAD
67
- path = if _index && _type && _id
68
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_source"
69
- else
70
- "#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
71
- end
64
+ path = "#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
72
65
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
73
66
 
74
67
  body = nil
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  #
32
32
  # @option arguments [String] :id The document ID
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [String] :type The type of the document *Deprecated*
35
34
  # @option arguments [Boolean] :analyze_wildcard Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
36
35
  # @option arguments [String] :analyzer The analyzer for the query string query
37
36
  # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR)
@@ -65,19 +64,13 @@ module OpenSearch
65
64
 
66
65
  _index = arguments.delete(:index)
67
66
 
68
- _type = arguments.delete(:type)
69
-
70
67
  method = if arguments[:body]
71
68
  OpenSearch::API::HTTP_POST
72
69
  else
73
70
  OpenSearch::API::HTTP_GET
74
71
  end
75
72
 
76
- path = if _index && _type && _id
77
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_explain"
78
- else
79
- "#{Utils.__listify(_index)}/_explain/#{Utils.__listify(_id)}"
80
- end
73
+ path = "#{Utils.__listify(_index)}/_explain/#{Utils.__listify(_id)}"
81
74
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
82
75
 
83
76
  body = arguments[:body]
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  #
32
32
  # @option arguments [String] :id The document ID
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [String] :type The type of the document (use `_all` to fetch the first document matching the ID across all types) *Deprecated*
35
34
  # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
36
35
  # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
37
36
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
@@ -62,14 +61,8 @@ module OpenSearch
62
61
 
63
62
  _index = arguments.delete(:index)
64
63
 
65
- _type = arguments.delete(:type)
66
-
67
64
  method = OpenSearch::API::HTTP_GET
68
- path = if _index && _type && _id
69
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
70
- else
71
- "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
72
- end
65
+ path = "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
73
66
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
74
67
 
75
68
  body = nil
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  #
32
32
  # @option arguments [String] :id The document ID
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [String] :type The type of the document; deprecated and optional starting with 7.0 *Deprecated*
35
34
  # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
36
35
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
37
36
  # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation
@@ -61,14 +60,8 @@ module OpenSearch
61
60
 
62
61
  _index = arguments.delete(:index)
63
62
 
64
- _type = arguments.delete(:type)
65
-
66
63
  method = OpenSearch::API::HTTP_GET
67
- path = if _index && _type && _id
68
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/_source"
69
- else
70
- "#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
71
- end
64
+ path = "#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}"
72
65
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
73
66
 
74
67
  body = nil
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  #
32
32
  # @option arguments [String] :id Document ID
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [String] :type The type of the document *Deprecated*
35
34
  # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
36
35
  # @option arguments [String] :op_type Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID (options: index, create)
37
36
  # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for)
@@ -64,15 +63,9 @@ module OpenSearch
64
63
 
65
64
  _index = arguments.delete(:index)
66
65
 
67
- _type = arguments.delete(:type)
68
-
69
66
  method = _id ? OpenSearch::API::HTTP_PUT : OpenSearch::API::HTTP_POST
70
- path = if _index && _type && _id
71
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}"
72
- elsif _index && _id
67
+ path = if _index && _id
73
68
  "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}"
74
- elsif _index && _type
75
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}"
76
69
  else
77
70
  "#{Utils.__listify(_index)}/_doc"
78
71
  end
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  # Creates an index with optional settings and mappings.
32
32
  #
33
33
  # @option arguments [String] :index The name of the index
34
- # @option arguments [Boolean] :include_type_name Whether a type should be expected in the body of the mappings.
35
34
  # @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for before the operation returns.
36
35
  # @option arguments [Time] :timeout Explicit operation timeout
37
36
  # @option arguments [Time] :master_timeout Specify timeout for connection to master
@@ -60,7 +59,6 @@ module OpenSearch
60
59
  #
61
60
  # @since 6.2.0
62
61
  ParamsRegistry.register(:create, [
63
- :include_type_name,
64
62
  :wait_for_active_shards,
65
63
  :timeout,
66
64
  :master_timeout
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  # Returns information about one or more indices.
32
32
  #
33
33
  # @option arguments [List] :index A comma-separated list of index names
34
- # @option arguments [Boolean] :include_type_name Whether to add the type name to the response (default: false)
35
34
  # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
36
35
  # @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false)
37
36
  # @option arguments [Boolean] :allow_no_indices Ignore if a wildcard expression resolves to no concrete indices (default: false)
@@ -63,7 +62,6 @@ module OpenSearch
63
62
  #
64
63
  # @since 6.2.0
65
64
  ParamsRegistry.register(:get, [
66
- :include_type_name,
67
65
  :local,
68
66
  :ignore_unavailable,
69
67
  :allow_no_indices,
@@ -32,8 +32,6 @@ module OpenSearch
32
32
  #
33
33
  # @option arguments [List] :fields A comma-separated list of fields
34
34
  # @option arguments [List] :index A comma-separated list of index names
35
- # @option arguments [List] :type A comma-separated list of document types *Deprecated*
36
- # @option arguments [Boolean] :include_type_name Whether a type should be returned in the body of the mappings.
37
35
  # @option arguments [Boolean] :include_defaults Whether the default mapping values should be returned as well
38
36
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
39
37
  # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
@@ -57,15 +55,9 @@ module OpenSearch
57
55
 
58
56
  _index = arguments.delete(:index)
59
57
 
60
- _type = arguments.delete(:type)
61
-
62
58
  method = OpenSearch::API::HTTP_GET
63
- path = if _index && _type && _fields
64
- "#{Utils.__listify(_index)}/_mapping/#{Utils.__listify(_type)}/field/#{Utils.__listify(_fields)}"
65
- elsif _index && _fields
59
+ path = if _index && _fields
66
60
  "#{Utils.__listify(_index)}/_mapping/field/#{Utils.__listify(_fields)}"
67
- elsif _type && _fields
68
- "_mapping/#{Utils.__listify(_type)}/field/#{Utils.__listify(_fields)}"
69
61
  else
70
62
  "_mapping/field/#{Utils.__listify(_fields)}"
71
63
  end
@@ -79,7 +71,6 @@ module OpenSearch
79
71
  #
80
72
  # @since 6.2.0
81
73
  ParamsRegistry.register(:get_field_mapping, [
82
- :include_type_name,
83
74
  :include_defaults,
84
75
  :ignore_unavailable,
85
76
  :allow_no_indices,
@@ -31,8 +31,6 @@ module OpenSearch
31
31
  # Returns mappings for one or more indices.
32
32
  #
33
33
  # @option arguments [List] :index A comma-separated list of index names
34
- # @option arguments [List] :type A comma-separated list of document types *Deprecated*
35
- # @option arguments [Boolean] :include_type_name Whether to add the type name to the response (default: false)
36
34
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
37
35
  # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
38
36
  # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
@@ -53,15 +51,9 @@ module OpenSearch
53
51
 
54
52
  _index = arguments.delete(:index)
55
53
 
56
- _type = arguments.delete(:type)
57
-
58
54
  method = OpenSearch::API::HTTP_GET
59
- path = if _index && _type
60
- "#{Utils.__listify(_index)}/_mapping/#{Utils.__listify(_type)}"
61
- elsif _index
55
+ path = if _index
62
56
  "#{Utils.__listify(_index)}/_mapping"
63
- elsif _type
64
- "_mapping/#{Utils.__listify(_type)}"
65
57
  else
66
58
  "_mapping"
67
59
  end
@@ -75,7 +67,6 @@ module OpenSearch
75
67
  #
76
68
  # @since 6.2.0
77
69
  ParamsRegistry.register(:get_mapping, [
78
- :include_type_name,
79
70
  :ignore_unavailable,
80
71
  :allow_no_indices,
81
72
  :expand_wildcards,
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  # Returns an index template.
32
32
  #
33
33
  # @option arguments [List] :name The comma separated names of the index templates
34
- # @option arguments [Boolean] :include_type_name Whether a type should be returned in the body of the mappings.
35
34
  # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false)
36
35
  # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
37
36
  # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
@@ -61,7 +60,6 @@ module OpenSearch
61
60
  #
62
61
  # @since 6.2.0
63
62
  ParamsRegistry.register(:get_template, [
64
- :include_type_name,
65
63
  :flat_settings,
66
64
  :master_timeout,
67
65
  :local
@@ -31,8 +31,6 @@ module OpenSearch
31
31
  # Updates the index mappings.
32
32
  #
33
33
  # @option arguments [List] :index A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices.
34
- # @option arguments [String] :type The name of the document type *Deprecated*
35
- # @option arguments [Boolean] :include_type_name Whether a type should be expected in the body of the mappings.
36
34
  # @option arguments [Time] :timeout Explicit operation timeout
37
35
  # @option arguments [Time] :master_timeout Specify timeout for connection to master
38
36
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
@@ -57,16 +55,8 @@ module OpenSearch
57
55
 
58
56
  _index = arguments.delete(:index)
59
57
 
60
- _type = arguments.delete(:type)
61
-
62
58
  method = OpenSearch::API::HTTP_PUT
63
- path = if _index && _type
64
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_mappings"
65
- elsif _index
66
- "#{Utils.__listify(_index)}/_mappings"
67
- elsif _type
68
- "_mappings/#{Utils.__listify(_type)}"
69
- end
59
+ path = "#{Utils.__listify(_index)}/_mappings"
70
60
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
71
61
 
72
62
  body = arguments[:body]
@@ -77,7 +67,6 @@ module OpenSearch
77
67
  #
78
68
  # @since 6.2.0
79
69
  ParamsRegistry.register(:put_mapping, [
80
- :include_type_name,
81
70
  :timeout,
82
71
  :master_timeout,
83
72
  :ignore_unavailable,
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  # Creates or updates an index template.
32
32
  #
33
33
  # @option arguments [String] :name The name of the template
34
- # @option arguments [Boolean] :include_type_name Whether a type should be returned in the body of the mappings.
35
34
  # @option arguments [Number] :order The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)
36
35
  # @option arguments [Boolean] :create Whether the index template should only be added if new or can also replace an existing one
37
36
  # @option arguments [Time] :master_timeout Specify timeout for connection to master
@@ -61,7 +60,6 @@ module OpenSearch
61
60
  #
62
61
  # @since 6.2.0
63
62
  ParamsRegistry.register(:put_template, [
64
- :include_type_name,
65
63
  :order,
66
64
  :create,
67
65
  :master_timeout
@@ -33,7 +33,6 @@ module OpenSearch
33
33
  #
34
34
  # @option arguments [String] :alias The name of the alias to rollover
35
35
  # @option arguments [String] :new_index The name of the rollover index
36
- # @option arguments [Boolean] :include_type_name Whether a type should be included in the body of the mappings.
37
36
  # @option arguments [Time] :timeout Explicit operation timeout
38
37
  # @option arguments [Boolean] :dry_run If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false
39
38
  # @option arguments [Time] :master_timeout Specify timeout for connection to master
@@ -69,7 +68,6 @@ module OpenSearch
69
68
  #
70
69
  # @since 6.2.0
71
70
  ParamsRegistry.register(:rollover, [
72
- :include_type_name,
73
71
  :timeout,
74
72
  :dry_run,
75
73
  :master_timeout,
@@ -31,7 +31,6 @@ module OpenSearch
31
31
  # Allows a user to validate a potentially expensive query without executing it.
32
32
  #
33
33
  # @option arguments [List] :index A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices
34
- # @option arguments [List] :type A comma-separated list of document types to restrict the operation; leave empty to perform the operation on all types *Deprecated*
35
34
  # @option arguments [Boolean] :explain Return detailed information about the error
36
35
  # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
37
36
  # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
@@ -60,17 +59,13 @@ module OpenSearch
60
59
 
61
60
  _index = arguments.delete(:index)
62
61
 
63
- _type = arguments.delete(:type)
64
-
65
62
  method = if arguments[:body]
66
63
  OpenSearch::API::HTTP_POST
67
64
  else
68
65
  OpenSearch::API::HTTP_GET
69
66
  end
70
67
 
71
- path = if _index && _type
72
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_validate/query"
73
- elsif _index
68
+ path = if _index
74
69
  "#{Utils.__listify(_index)}/_validate/query"
75
70
  else
76
71
  "_validate/query"
@@ -30,7 +30,6 @@ module OpenSearch
30
30
  # Allows to get multiple documents in one request.
31
31
  #
32
32
  # @option arguments [String] :index The name of the index
33
- # @option arguments [String] :type The type of the document *Deprecated*
34
33
  # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response
35
34
  # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random)
36
35
  # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode
@@ -40,7 +39,7 @@ module OpenSearch
40
39
  # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field
41
40
  # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
42
41
  # @option arguments [Hash] :headers Custom HTTP headers
43
- # @option arguments [Hash] :body Document identifiers; can be either `docs` (containing full document information) or `ids` (when index and type is provided in the URL. (*Required*)
42
+ # @option arguments [Hash] :body Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. (*Required*)
44
43
  #
45
44
  # *Deprecation notice*:
46
45
  # Specifying types in urls has been deprecated
@@ -57,12 +56,8 @@ module OpenSearch
57
56
 
58
57
  _index = arguments.delete(:index)
59
58
 
60
- _type = arguments.delete(:type)
61
-
62
59
  method = OpenSearch::API::HTTP_POST
63
- path = if _index && _type
64
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_mget"
65
- elsif _index
60
+ path = if _index
66
61
  "#{Utils.__listify(_index)}/_mget"
67
62
  else
68
63
  "_mget"
@@ -30,7 +30,6 @@ module OpenSearch
30
30
  # Allows to execute several search operations in one request.
31
31
  #
32
32
  # @option arguments [List] :index A comma-separated list of index names to use as default
33
- # @option arguments [List] :type A comma-separated list of document types to use as default
34
33
  # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch)
35
34
  # @option arguments [Number] :max_concurrent_searches Controls the maximum number of concurrent searches the multi search api will execute
36
35
  # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response
@@ -56,12 +55,8 @@ module OpenSearch
56
55
 
57
56
  _index = arguments.delete(:index)
58
57
 
59
- _type = arguments.delete(:type)
60
-
61
58
  method = OpenSearch::API::HTTP_POST
62
- path = if _index && _type
63
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_msearch"
64
- elsif _index
59
+ path = if _index
65
60
  "#{Utils.__listify(_index)}/_msearch"
66
61
  else
67
62
  "_msearch"
@@ -30,7 +30,6 @@ module OpenSearch
30
30
  # Allows to execute several search template operations in one request.
31
31
  #
32
32
  # @option arguments [List] :index A comma-separated list of index names to use as default
33
- # @option arguments [List] :type A comma-separated list of document types to use as default
34
33
  # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch)
35
34
  # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response
36
35
  # @option arguments [Number] :max_concurrent_searches Controls the maximum number of concurrent searches the multi search api will execute
@@ -54,12 +53,8 @@ module OpenSearch
54
53
 
55
54
  _index = arguments.delete(:index)
56
55
 
57
- _type = arguments.delete(:type)
58
-
59
56
  method = OpenSearch::API::HTTP_POST
60
- path = if _index && _type
61
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_msearch/template"
62
- elsif _index
57
+ path = if _index
63
58
  "#{Utils.__listify(_index)}/_msearch/template"
64
59
  else
65
60
  "_msearch/template"
@@ -30,7 +30,6 @@ module OpenSearch
30
30
  # Returns multiple termvectors in one request.
31
31
  #
32
32
  # @option arguments [String] :index The index in which the document resides.
33
- # @option arguments [String] :type The type of the document.
34
33
  # @option arguments [List] :ids A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body
35
34
  # @option arguments [Boolean] :term_statistics Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
36
35
  # @option arguments [Boolean] :field_statistics Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs".
@@ -60,17 +59,13 @@ module OpenSearch
60
59
 
61
60
  _index = arguments.delete(:index)
62
61
 
63
- _type = arguments.delete(:type)
64
-
65
62
  method = if arguments[:body]
66
63
  OpenSearch::API::HTTP_POST
67
64
  else
68
65
  OpenSearch::API::HTTP_GET
69
66
  end
70
67
 
71
- path = if _index && _type
72
- "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_mtermvectors"
73
- elsif _index
68
+ path = if _index
74
69
  "#{Utils.__listify(_index)}/_mtermvectors"
75
70
  else
76
71
  "_mtermvectors"