You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The API now makes a request, instead of calling index like in previous versions (< 9.0.0).
* `body`, `index` and `id` are now required parameters.
* `op_type` is now a String parameter: Set to 'create' to only index the document if it does not
already exist (put if absent). If a document with the specified '_id' already exists, the indexing
operation will fail. The behavior is the same as using the '<index>/_create' endpoint. If a document
ID is specified, this paramater defaults to 'index'. Otherwise, it defaults to `create`. If the
request targets a data stream, an `op_type` of `create` is required.
Additional new parameters:
* :if_primary_term (Integer) - Only perform the operation if the document has this primary term.
* :if_seq_no (Integer) - Only perform the operation if the document has this sequence number.
Copy file name to clipboardExpand all lines: elasticsearch-api/lib/elasticsearch/api/actions/create.rb
+30-5Lines changed: 30 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -77,13 +77,23 @@ module Actions
77
77
# @option arguments [String] :index The name of the data stream or index to target.
78
78
# If the target doesn't exist and matches the name or wildcard (+*+) pattern of an index template with a +data_stream+ definition, this request creates the data stream.
79
79
# If the target doesn't exist and doesn’t match a data stream template, this request creates the index. (*Required*)
80
+
# @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term.
81
+
# @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number.
80
82
# @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true.
83
+
# @option arguments [String] :op_type Set to +create+ to only index the document if it does not already exist (put if absent).
84
+
# If a document with the specified +_id+ already exists, the indexing operation will fail.
85
+
# The behavior is the same as using the +<index>/_create+ endpoint.
86
+
# If a document ID is specified, this paramater defaults to +index+.
87
+
# Otherwise, it defaults to +create+.
88
+
# If the request targets a data stream, an +op_type+ of +create+ is required.
81
89
# @option arguments [String] :pipeline The ID of the pipeline to use to preprocess incoming documents.
82
90
# If the index has a default ingest pipeline specified, setting the value to +_none+ turns off the default ingest pipeline for this request.
83
91
# If a final pipeline is configured, it will always run regardless of the value of this parameter.
84
92
# @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search.
85
93
# If +wait_for+, it waits for a refresh to make this operation visible to search.
86
94
# If +false+, it does nothing with refreshes. Server default: false.
95
+
# @option arguments [Boolean] :require_alias If +true+, the destination must be an index alias.
96
+
# @option arguments [Boolean] :require_data_stream If +true+, the request's actions must target a data stream (existing or to be created).
87
97
# @option arguments [String] :routing A custom value that is used to route operations to a specific shard.
88
98
# @option arguments [Time] :timeout The period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
89
99
# Elasticsearch waits for at least the specified timeout period before failing.
0 commit comments