Class IndexDescriptor<TDocument>
Descriptor for Index
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/
Inheritance
IndexDescriptor<TDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class IndexDescriptor<TDocument> : RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>, IDescriptor, IIndexRequest<TDocument>, IProxyRequest, IDocumentRequest, IRequest<IndexRequestParameters>, IRequest where TDocument : class
Type Parameters
Name |
Description |
TDocument |
|
Constructors
|
Edit this page
View Source
IndexDescriptor()
Declaration
|
Edit this page
View Source
IndexDescriptor(Id)
Declaration
public IndexDescriptor(Id id)
Parameters
Type |
Name |
Description |
Id |
id |
Optional, accepts null
|
|
Edit this page
View Source
IndexDescriptor(IndexName)
Declaration
public IndexDescriptor(IndexName index)
Parameters
Type |
Name |
Description |
IndexName |
index |
this parameter is required
|
|
Edit this page
View Source
IndexDescriptor(IndexName, Id)
Declaration
public IndexDescriptor(IndexName index, Id id)
Parameters
Type |
Name |
Description |
IndexName |
index |
this parameter is required
|
Id |
id |
Optional, accepts null
|
|
Edit this page
View Source
IndexDescriptor(TDocument, IndexName, Id)
Declaration
public IndexDescriptor(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
|
Properties
|
Edit this page
View Source
HttpMethod
Declaration
protected override HttpMethod HttpMethod { get; }
Property Value
Overrides
Methods
|
Edit this page
View Source
Id(Id)
Declaration
public IndexDescriptor<TDocument> Id(Id id)
Parameters
Type |
Name |
Description |
Id |
id |
|
Returns
|
Edit this page
View Source
IfPrimaryTerm(long?)
only perform the index operation if the last operation that has changed the document has the specified primary term
Declaration
public IndexDescriptor<TDocument> IfPrimaryTerm(long? ifprimaryterm)
Parameters
Type |
Name |
Description |
long? |
ifprimaryterm |
|
Returns
|
Edit this page
View Source
IfSequenceNumber(long?)
only perform the index operation if the last operation that has changed the document has the specified sequence number
Declaration
public IndexDescriptor<TDocument> IfSequenceNumber(long? ifsequencenumber)
Parameters
Type |
Name |
Description |
long? |
ifsequencenumber |
|
Returns
|
Edit this page
View Source
Index(IndexName)
Declaration
public IndexDescriptor<TDocument> Index(IndexName index)
Parameters
Returns
|
Edit this page
View Source
Index<TOther>()
a shortcut into calling Index(typeof(TOther))
Declaration
public IndexDescriptor<TDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
OpType(OpType?)
Explicit operation type. Defaults to index
for requests with an explicit document ID, and to create
for requests without an explicit document ID
Declaration
public IndexDescriptor<TDocument> OpType(OpType? optype)
Parameters
Type |
Name |
Description |
OpType? |
optype |
|
Returns
|
Edit this page
View Source
Pipeline(string)
The pipeline id to preprocess incoming documents with
Declaration
public IndexDescriptor<TDocument> Pipeline(string pipeline)
Parameters
Type |
Name |
Description |
string |
pipeline |
|
Returns
|
Edit this page
View Source
Refresh(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.
Declaration
public IndexDescriptor<TDocument> Refresh(Refresh? refresh)
Parameters
Type |
Name |
Description |
Refresh? |
refresh |
|
Returns
|
Edit this page
View Source
RequireAlias(bool?)
When true, requires destination to be an alias. Default is false
Declaration
public IndexDescriptor<TDocument> RequireAlias(bool? requirealias = true)
Parameters
Type |
Name |
Description |
bool? |
requirealias |
|
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 OSC 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 IndexDescriptor<TDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
Timeout(Time)
Explicit operation timeout
Declaration
public IndexDescriptor<TDocument> Timeout(Time timeout)
Parameters
Type |
Name |
Description |
Time |
timeout |
|
Returns
|
Edit this page
View Source
Version(long?)
Explicit version number for concurrency control
Declaration
public IndexDescriptor<TDocument> Version(long? version)
Parameters
Type |
Name |
Description |
long? |
version |
|
Returns
|
Edit this page
View Source
VersionType(VersionType?)
Declaration
public IndexDescriptor<TDocument> VersionType(VersionType? versiontype)
Parameters
Returns
|
Edit this page
View Source
WaitForActiveShards(string)
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)
Declaration
public IndexDescriptor<TDocument> WaitForActiveShards(string waitforactiveshards)
Parameters
Type |
Name |
Description |
string |
waitforactiveshards |
|
Returns
Implements
Extension Methods