Search Results for

    Show / Hide Table of Contents

    Class IndexDescriptor<TDocument>

    Descriptor for Index

    https://opensearch.org/docs/latest/api-reference/document-apis/index-document/

    Inheritance
    object
    RequestBase<IndexRequestParameters>
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>
    IndexDescriptor<TDocument>
    Implements
    IDescriptor
    IIndexRequest<TDocument>
    IProxyRequest
    IDocumentRequest
    IRequest<IndexRequestParameters>
    IRequest
    Inherited Members
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.Self
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.Assign<TValue>(TValue, Action<IIndexRequest<TDocument>, TValue>)
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.Qs(string, object)
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.RequestConfiguration(Func<RequestConfigurationDescriptor, IRequestConfiguration>)
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.ErrorTrace(bool?)
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.FilterPath(params string[])
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.FilterPath(IEnumerable<string>)
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.Human(bool?)
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.Pretty(bool?)
    RequestDescriptorBase<IndexDescriptor<TDocument>, IndexRequestParameters, IIndexRequest<TDocument>>.SourceQueryString(string)
    RequestBase<IndexRequestParameters>.RequestState
    RequestBase<IndexRequestParameters>.ContentType
    RequestBase<IndexRequestParameters>.ResolveUrl(RouteValues, IConnectionSettingsValues)
    RequestBase<IndexRequestParameters>.RequestDefaults(IndexRequestParameters)
    RequestBase<IndexRequestParameters>.Q<TOut>(string)
    RequestBase<IndexRequestParameters>.Q(string, object)
    RequestBase<IndexRequestParameters>.SetAcceptHeader(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OpenSearch.Client
    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()

    /{index}/_doc

    Declaration
    public IndexDescriptor()
    | Edit this page View Source

    IndexDescriptor(Id)

    /{index}/_doc/{id}

    Declaration
    public IndexDescriptor(Id id)
    Parameters
    Type Name Description
    Id id

    Optional, accepts null

    | Edit this page View Source

    IndexDescriptor(IndexName)

    /{index}/_doc

    Declaration
    public IndexDescriptor(IndexName index)
    Parameters
    Type Name Description
    IndexName index

    this parameter is required

    | Edit this page View Source

    IndexDescriptor(IndexName, Id)

    /{index}/_doc/{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)

    /{index}/_doc/{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
    Type Description
    HttpMethod
    Overrides
    RequestBase<IndexRequestParameters>.HttpMethod

    Methods

    | Edit this page View Source

    Id(Id)

    Unique identifier for the document.

    Declaration
    public IndexDescriptor<TDocument> Id(Id id)
    Parameters
    Type Name Description
    Id id
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | Edit this page View Source

    IfPrimaryTerm(long?)

    Only perform the operation if the document has this primary term.

    Declaration
    public IndexDescriptor<TDocument> IfPrimaryTerm(long? ifprimaryterm)
    Parameters
    Type Name Description
    long? ifprimaryterm
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | Edit this page View Source

    IfSequenceNumber(long?)

    Only perform the operation if the document has this sequence number.

    Declaration
    public IndexDescriptor<TDocument> IfSequenceNumber(long? ifsequencenumber)
    Parameters
    Type Name Description
    long? ifsequencenumber
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | Edit this page View Source

    Index(IndexName)

    Name of the data stream or index to target.

    Declaration
    public IndexDescriptor<TDocument> Index(IndexName index)
    Parameters
    Type Name Description
    IndexName index
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | 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 Description
    IndexDescriptor<TDocument>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    OpType(OpType?)

    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. Same as using the <index>/_create endpoint. Valid values: index, create. If document id is specified, it defaults to index. Otherwise, it defaults to create.

    Declaration
    public IndexDescriptor<TDocument> OpType(OpType? optype)
    Parameters
    Type Name Description
    OpType? optype
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | 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 IndexDescriptor<TDocument> Pipeline(string pipeline)
    Parameters
    Type Name Description
    string pipeline
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | 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 IndexDescriptor<TDocument> Refresh(Refresh? refresh)
    Parameters
    Type Name Description
    Refresh? refresh
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | Edit this page View Source

    RequireAlias(bool?)

    If true, the destination must be an index alias.

    Declaration
    public IndexDescriptor<TDocument> RequireAlias(bool? requirealias = true)
    Parameters
    Type Name Description
    bool? requirealias
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | 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 IndexDescriptor<TDocument> Routing(Routing routing)
    Parameters
    Type Name Description
    Routing routing
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | 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 IndexDescriptor<TDocument> Timeout(Time timeout)
    Parameters
    Type Name Description
    Time timeout
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | 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 IndexDescriptor<TDocument> Version(long? version)
    Parameters
    Type Name Description
    long? version
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | Edit this page View Source

    VersionType(VersionType?)

    Specific version type: external, external_gte.

    Declaration
    public IndexDescriptor<TDocument> VersionType(VersionType? versiontype)
    Parameters
    Type Name Description
    VersionType? versiontype
    Returns
    Type Description
    IndexDescriptor<TDocument>
    | 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 IndexDescriptor<TDocument> WaitForActiveShards(string waitforactiveshards)
    Parameters
    Type Name Description
    string waitforactiveshards
    Returns
    Type Description
    IndexDescriptor<TDocument>

    Implements

    IDescriptor
    IIndexRequest<TDocument>
    IProxyRequest
    IDocumentRequest
    IRequest<TParameters>
    IRequest

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Constructors
      • IndexDescriptor()
      • IndexDescriptor(Id)
      • IndexDescriptor(IndexName)
      • IndexDescriptor(IndexName, Id)
      • IndexDescriptor(TDocument, IndexName, Id)
    • Properties
      • HttpMethod
    • Methods
      • Id(Id)
      • IfPrimaryTerm(long?)
      • IfSequenceNumber(long?)
      • Index(IndexName)
      • Index<TOther>()
      • OpType(OpType?)
      • Pipeline(string)
      • Refresh(Refresh?)
      • RequireAlias(bool?)
      • Routing(Routing)
      • Timeout(Time)
      • Version(long?)
      • VersionType(VersionType?)
      • WaitForActiveShards(string)
    • Implements
    • Extension Methods
    Back to top Generated by DocFX