Search Results for

    Show / Hide Table of Contents

    Class DeleteByQueryDescriptor<TDocument>

    Delete documents that match a given query

    Inheritance
    object
    RequestBase<DeleteByQueryRequestParameters>
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>
    DeleteByQueryDescriptor<TDocument>
    Implements
    IDescriptor
    IDeleteByQueryRequest<TDocument>
    IDeleteByQueryRequest
    IRequest<DeleteByQueryRequestParameters>
    IRequest
    Inherited Members
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.Self
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.Assign<TValue>(TValue, Action<IDeleteByQueryRequest<TDocument>, TValue>)
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.Qs(string, object)
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.RequestConfiguration(Func<RequestConfigurationDescriptor, IRequestConfiguration>)
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.ErrorTrace(bool?)
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.FilterPath(params string[])
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.FilterPath(IEnumerable<string>)
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.Human(bool?)
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.Pretty(bool?)
    RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>.SourceQueryString(string)
    RequestBase<DeleteByQueryRequestParameters>.HttpMethod
    RequestBase<DeleteByQueryRequestParameters>.RequestState
    RequestBase<DeleteByQueryRequestParameters>.ContentType
    RequestBase<DeleteByQueryRequestParameters>.ResolveUrl(RouteValues, IConnectionSettingsValues)
    RequestBase<DeleteByQueryRequestParameters>.RequestDefaults(DeleteByQueryRequestParameters)
    RequestBase<DeleteByQueryRequestParameters>.Q<TOut>(string)
    RequestBase<DeleteByQueryRequestParameters>.Q(string, object)
    RequestBase<DeleteByQueryRequestParameters>.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 DeleteByQueryDescriptor<TDocument> : RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>, IDescriptor, IDeleteByQueryRequest<TDocument>, IDeleteByQueryRequest, IRequest<DeleteByQueryRequestParameters>, IRequest where TDocument : class
    Type Parameters
    Name Description
    TDocument

    Constructors

    | Edit this page View Source

    DeleteByQueryDescriptor()

    /{index}/_delete_by_query

    Declaration
    public DeleteByQueryDescriptor()
    | Edit this page View Source

    DeleteByQueryDescriptor(Indices)

    /{index}/_delete_by_query

    Declaration
    public DeleteByQueryDescriptor(Indices index)
    Parameters
    Type Name Description
    Indices index

    this parameter is required

    Methods

    | Edit this page View Source

    AllIndices()

    A shortcut into calling Index(Indices.All)

    Declaration
    public DeleteByQueryDescriptor<TDocument> AllIndices()
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    AllowNoIndices(bool?)

    If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

    Declaration
    public DeleteByQueryDescriptor<TDocument> AllowNoIndices(bool? allownoindices = true)
    Parameters
    Type Name Description
    bool? allownoindices
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    AnalyzeWildcard(bool?)

    If true, wildcard and prefix queries are analyzed.

    Declaration
    public DeleteByQueryDescriptor<TDocument> AnalyzeWildcard(bool? analyzewildcard = true)
    Parameters
    Type Name Description
    bool? analyzewildcard
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Analyzer(string)

    Analyzer to use for the query string.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Analyzer(string analyzer)
    Parameters
    Type Name Description
    string analyzer
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Conflicts(Conflicts?)

    What to do if delete by query hits version conflicts: abort or proceed.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Conflicts(Conflicts? conflicts)
    Parameters
    Type Name Description
    Conflicts? conflicts
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    DefaultOperator(DefaultOperator?)

    The default operator for query string query: AND or OR.

    Declaration
    public DeleteByQueryDescriptor<TDocument> DefaultOperator(DefaultOperator? defaultoperator)
    Parameters
    Type Name Description
    DefaultOperator? defaultoperator
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Df(string)

    Field to use as default where no field prefix is given in the query string.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Df(string df)
    Parameters
    Type Name Description
    string df
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    ExpandWildcards(ExpandWildcards?)

    Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as open,hidden. Valid values are: all, open, closed, hidden, none.

    Declaration
    public DeleteByQueryDescriptor<TDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
    Parameters
    Type Name Description
    ExpandWildcards? expandwildcards
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    From(int?)

    Starting offset.

    Declaration
    public DeleteByQueryDescriptor<TDocument> From(int? from)
    Parameters
    Type Name Description
    int? from
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    IgnoreUnavailable(bool?)

    If false, the request returns an error if it targets a missing or closed index.

    Declaration
    public DeleteByQueryDescriptor<TDocument> IgnoreUnavailable(bool? ignoreunavailable = true)
    Parameters
    Type Name Description
    bool? ignoreunavailable
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Index(Indices)

    Comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (*). To search all data streams or indexes, omit this parameter or use * or _all.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Index(Indices index)
    Parameters
    Type Name Description
    Indices index
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Index<TOther>()

    a shortcut into calling Index(typeof(TOther))

    Declaration
    public DeleteByQueryDescriptor<TDocument> Index<TOther>() where TOther : class
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    Type Parameters
    Name Description
    TOther
    | Edit this page View Source

    Lenient(bool?)

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Lenient(bool? lenient = true)
    Parameters
    Type Name Description
    bool? lenient
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    MatchAll()

    A match_all query to select all documents. Convenient shorthand for specifying a match_all query using Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer>)

    Declaration
    public DeleteByQueryDescriptor<TDocument> MatchAll()
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    MaximumDocuments(long?)

    Limit the number of processed documents

    Declaration
    public DeleteByQueryDescriptor<TDocument> MaximumDocuments(long? maximumDocuments)
    Parameters
    Type Name Description
    long? maximumDocuments
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Preference(string)

    Specifies the node or shard the operation should be performed on. Random by default.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Preference(string preference)
    Parameters
    Type Name Description
    string preference
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer>)

    The query to use to select documents for deletion

    Declaration
    public DeleteByQueryDescriptor<TDocument> Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer> querySelector)
    Parameters
    Type Name Description
    Func<QueryContainerDescriptor<TDocument>, QueryContainer> querySelector
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    QueryOnQueryString(string)

    Query in the Lucene query string syntax.

    Declaration
    public DeleteByQueryDescriptor<TDocument> QueryOnQueryString(string queryonquerystring)
    Parameters
    Type Name Description
    string queryonquerystring
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Refresh(Refresh?)

    If true, OpenSearch refreshes all shards involved in the delete by query after the request completes.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Refresh(Refresh? refresh)
    Parameters
    Type Name Description
    Refresh? refresh
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    RequestCache(bool?)

    If true, the request cache is used for this request. Defaults to the index-level setting.

    Declaration
    public DeleteByQueryDescriptor<TDocument> RequestCache(bool? requestcache = true)
    Parameters
    Type Name Description
    bool? requestcache
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    RequestsPerSecond(float?)

    The throttle for this request in sub-requests per second.

    Declaration
    public DeleteByQueryDescriptor<TDocument> RequestsPerSecond(float? requestspersecond)
    Parameters
    Type Name Description
    float? requestspersecond
    Returns
    Type Description
    DeleteByQueryDescriptor<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 DeleteByQueryDescriptor<TDocument> Routing(Routing routing)
    Parameters
    Type Name Description
    Routing routing
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Scroll(Time)

    Period to retain the search context for scrolling.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Scroll(Time scroll)
    Parameters
    Type Name Description
    Time scroll
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    ScrollSize(int?)

    Size of the scroll request that powers the operation.

    Declaration
    public DeleteByQueryDescriptor<TDocument> ScrollSize(int? scrollsize)
    Parameters
    Type Name Description
    int? scrollsize
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    SearchTimeout(Time)

    Explicit timeout for each search request. Defaults to no timeout.

    Declaration
    public DeleteByQueryDescriptor<TDocument> SearchTimeout(Time searchtimeout)
    Parameters
    Type Name Description
    Time searchtimeout
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    SearchType(SearchType?)

    The type of the search operation. Available options: query_then_fetch, dfs_query_then_fetch.

    Declaration
    public DeleteByQueryDescriptor<TDocument> SearchType(SearchType? searchtype)
    Parameters
    Type Name Description
    SearchType? searchtype
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Size(int?)

    Deprecated, use max_docs instead.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Size(int? size)
    Parameters
    Type Name Description
    int? size
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Slice(Func<SlicedScrollDescriptor<TDocument>, ISlicedScroll>)

    Parallelize the deleting process. This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Slice(Func<SlicedScrollDescriptor<TDocument>, ISlicedScroll> selector)
    Parameters
    Type Name Description
    Func<SlicedScrollDescriptor<TDocument>, ISlicedScroll> selector
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Slices(Slices)

    The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Slices(Slices slices)
    Parameters
    Type Name Description
    Slices slices
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Sort(params string[])

    A comma-separated list of <field>:<direction> pairs.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Sort(params string[] sort)
    Parameters
    Type Name Description
    string[] sort
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    SourceEnabled(bool?)

    Whether the _source should be included in the response.

    Declaration
    public DeleteByQueryDescriptor<TDocument> SourceEnabled(bool? sourceenabled = true)
    Parameters
    Type Name Description
    bool? sourceenabled
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    SourceExcludes(Fields)

    List of fields to exclude from the returned _source field.

    Declaration
    public DeleteByQueryDescriptor<TDocument> SourceExcludes(Fields sourceexcludes)
    Parameters
    Type Name Description
    Fields sourceexcludes
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    SourceExcludes(params Expression<Func<TDocument, object>>[])

    List of fields to exclude from the returned _source field.

    Declaration
    public DeleteByQueryDescriptor<TDocument> SourceExcludes(params Expression<Func<TDocument, object>>[] fields)
    Parameters
    Type Name Description
    Expression<Func<TDocument, object>>[] fields
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    SourceIncludes(Fields)

    List of fields to extract and return from the _source field.

    Declaration
    public DeleteByQueryDescriptor<TDocument> SourceIncludes(Fields sourceincludes)
    Parameters
    Type Name Description
    Fields sourceincludes
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    SourceIncludes(params Expression<Func<TDocument, object>>[])

    List of fields to extract and return from the _source field.

    Declaration
    public DeleteByQueryDescriptor<TDocument> SourceIncludes(params Expression<Func<TDocument, object>>[] fields)
    Parameters
    Type Name Description
    Expression<Func<TDocument, object>>[] fields
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Stats(params string[])

    Specific tag of the request for logging and statistical purposes.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Stats(params string[] stats)
    Parameters
    Type Name Description
    string[] stats
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    TerminateAfter(int?)

    Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers.

    Declaration
    public DeleteByQueryDescriptor<TDocument> TerminateAfter(int? terminateafter)
    Parameters
    Type Name Description
    int? terminateafter
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Timeout(Time)

    Period each deletion request waits for active shards.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Timeout(Time timeout)
    Parameters
    Type Name Description
    Time timeout
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    Version(bool?)

    If true, returns the document version as part of a hit.

    Declaration
    public DeleteByQueryDescriptor<TDocument> Version(bool? version = true)
    Parameters
    Type Name Description
    bool? version
    Returns
    Type Description
    DeleteByQueryDescriptor<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 DeleteByQueryDescriptor<TDocument> WaitForActiveShards(string waitforactiveshards)
    Parameters
    Type Name Description
    string waitforactiveshards
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>
    | Edit this page View Source

    WaitForCompletion(bool?)

    If true, the request blocks until the operation is complete.

    Declaration
    public DeleteByQueryDescriptor<TDocument> WaitForCompletion(bool? waitforcompletion = true)
    Parameters
    Type Name Description
    bool? waitforcompletion
    Returns
    Type Description
    DeleteByQueryDescriptor<TDocument>

    Implements

    IDescriptor
    IDeleteByQueryRequest<TDocument>
    IDeleteByQueryRequest
    IRequest<TParameters>
    IRequest

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Constructors
      • DeleteByQueryDescriptor()
      • DeleteByQueryDescriptor(Indices)
    • Methods
      • AllIndices()
      • AllowNoIndices(bool?)
      • AnalyzeWildcard(bool?)
      • Analyzer(string)
      • Conflicts(Conflicts?)
      • DefaultOperator(DefaultOperator?)
      • Df(string)
      • ExpandWildcards(ExpandWildcards?)
      • From(int?)
      • IgnoreUnavailable(bool?)
      • Index(Indices)
      • Index<TOther>()
      • Lenient(bool?)
      • MatchAll()
      • MaximumDocuments(long?)
      • Preference(string)
      • Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer>)
      • QueryOnQueryString(string)
      • Refresh(Refresh?)
      • RequestCache(bool?)
      • RequestsPerSecond(float?)
      • Routing(Routing)
      • Scroll(Time)
      • ScrollSize(int?)
      • SearchTimeout(Time)
      • SearchType(SearchType?)
      • Size(int?)
      • Slice(Func<SlicedScrollDescriptor<TDocument>, ISlicedScroll>)
      • Slices(Slices)
      • Sort(params string[])
      • SourceEnabled(bool?)
      • SourceExcludes(Fields)
      • SourceExcludes(params Expression<Func<TDocument, object>>[])
      • SourceIncludes(Fields)
      • SourceIncludes(params Expression<Func<TDocument, object>>[])
      • Stats(params string[])
      • TerminateAfter(int?)
      • Timeout(Time)
      • Version(bool?)
      • WaitForActiveShards(string)
      • WaitForCompletion(bool?)
    • Implements
    • Extension Methods
    Back to top Generated by DocFX