Class CreateDescriptor<TDocument>
Descriptor for Create
https://opensearch.org/docs/latest/api-reference/document-apis/index-document/
Inheritance
CreateDescriptor<TDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class CreateDescriptor<TDocument> : RequestDescriptorBase<CreateDescriptor<TDocument>, CreateRequestParameters, ICreateRequest<TDocument>>, IDescriptor, ICreateRequest<TDocument>, IProxyRequest, IDocumentRequest, IRequest<CreateRequestParameters>, IRequest where TDocument : class
Type Parameters
Name |
Description |
TDocument |
|
Constructors
|
Edit this page
View Source
CreateDescriptor()
Used for serialization purposes, making sure we have a parameterless constructor
Declaration
protected CreateDescriptor()
|
Edit this page
View Source
CreateDescriptor(Id)
Declaration
public CreateDescriptor(Id id)
Parameters
Type |
Name |
Description |
Id |
id |
this parameter is required
|
|
Edit this page
View Source
CreateDescriptor(IndexName, Id)
Declaration
public CreateDescriptor(IndexName index, Id id)
Parameters
Type |
Name |
Description |
IndexName |
index |
this parameter is required
|
Id |
id |
this parameter is required
|
|
Edit this page
View Source
CreateDescriptor(TDocument, IndexName, Id)
Declaration
public CreateDescriptor(TDocument documentWithId, IndexName index = null, Id id = null)
Parameters
Type |
Name |
Description |
TDocument |
documentWithId |
|
IndexName |
index |
|
Id |
id |
The document used to resolve the path from
|
Methods
|
Edit this page
View Source
Id(Id)
Sets the id for the document. Overrides the id that may be inferred from the document.
Declaration
public CreateDescriptor<TDocument> Id(Id id)
Parameters
Type |
Name |
Description |
Id |
id |
|
Returns
|
Edit this page
View Source
Index(IndexName)
Name of the data stream or index to target. 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. If the target doesn't exist and doesn't match a data stream template, this request creates the index.
Declaration
public CreateDescriptor<TDocument> Index(IndexName index)
Parameters
Returns
|
Edit this page
View Source
Index<TOther>()
a shortcut into calling Index(typeof(TOther))
Declaration
public CreateDescriptor<TDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
Pipeline(string)
ID of the pipeline to use to preprocess incoming documents. If the index has a default ingest pipeline specified, then setting the value to _none
disables the default ingest pipeline for this request. If a final pipeline is configured it will always run, regardless of the value of this parameter.
Declaration
public CreateDescriptor<TDocument> Pipeline(string pipeline)
Parameters
Type |
Name |
Description |
string |
pipeline |
|
Returns
|
Edit this page
View Source
Refresh(Refresh?)
If true
, OpenSearch refreshes 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
do nothing with refreshes. Valid values: true
, false
, wait_for
.
Declaration
public CreateDescriptor<TDocument> Refresh(Refresh? refresh)
Parameters
Type |
Name |
Description |
Refresh? |
refresh |
|
Returns
|
Edit this page
View Source
Routing(Routing)
A document is routed to a particular shard in an index using the following formula
shard_num = hash(_routing) % num_primary_shards
OpenSearch will use the document id if not provided.
For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
if that document has a JoinField or a routing mapping on for its type exists on ConnectionSettings
Declaration
public CreateDescriptor<TDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
Timeout(Time)
Period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.
Declaration
public CreateDescriptor<TDocument> Timeout(Time timeout)
Parameters
Type |
Name |
Description |
Time |
timeout |
|
Returns
|
Edit this page
View Source
Version(long?)
Explicit version number for concurrency control. The specified version must match the current version of the document for the request to succeed.
Declaration
public CreateDescriptor<TDocument> Version(long? version)
Parameters
Type |
Name |
Description |
long? |
version |
|
Returns
|
Edit this page
View Source
VersionType(VersionType?)
Specific version type: external
, external_gte
.
Declaration
public CreateDescriptor<TDocument> VersionType(VersionType? versiontype)
Parameters
Returns
|
Edit this page
View Source
WaitForActiveShards(string)
The number of shard copies that must be active before proceeding with the operation. Set to all
or any positive integer up to the total number of shards in the index (number_of_replicas+1
).
Declaration
public CreateDescriptor<TDocument> WaitForActiveShards(string waitforactiveshards)
Parameters
Type |
Name |
Description |
string |
waitforactiveshards |
|
Returns
Implements
Extension Methods