public string IndexName(IndexName index) => IndexNameResolver.Resolve(index);
/// <summary> /// Manually set the index, default to the default index or the index set for the type on the connectionsettings. /// </summary> public MultiGetOperationDescriptor <T> Index(IndexName index) => Assign(index, (a, v) => a.Index = v);
/// <inheritdoc cref="RetryIlm(Nest6.IndexName,System.Func{Nest6.RetryIlmDescriptor,Nest6.IRetryIlmRequest})" /> public Task <IRetryIlmResponse> RetryIlmAsync(IndexName index, Func <RetryIlmDescriptor, IRetryIlmRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken) ) => RetryIlmAsync(selector.InvokeOrDefault(new RetryIlmDescriptor(index)), cancellationToken);
public MoveClusterRerouteCommandDescriptor Index(IndexName index) => Assign(index, (a, v) => a.Index = v);
/// <inheritdoc cref="ICreateFollowIndexRequest.LeaderIndex"/> public CreateFollowIndexDescriptor LeaderIndex(IndexName index) => Assign(index, (a, v) => a.LeaderIndex = v);
public Task <IShrinkIndexResponse> ShrinkIndexAsync( IndexName source, IndexName target, Func <ShrinkIndexDescriptor, IShrinkIndexRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken) ) => ShrinkIndexAsync(selector.InvokeOrDefault(new ShrinkIndexDescriptor(source, target)));
/// <inheritdoc cref="GetRollupIndexCapabilities(IndexName, System.Func{Nest6.GetRollupIndexCapabilitiesDescriptor,Nest6.IGetRollupIndexCapabilitiesRequest})" /> public IGetRollupIndexCapabilitiesResponse GetRollupIndexCapabilities( IndexName index, Func <GetRollupIndexCapabilitiesDescriptor, IGetRollupIndexCapabilitiesRequest> selector = null ) => GetRollupIndexCapabilities(selector.InvokeOrDefault(new GetRollupIndexCapabilitiesDescriptor(index)));
/// <summary> /// Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing). /// The response includes a docs array with all the fetched documents, each element similar in structure to a document /// provided by the get API. /// <para> </para> /// >http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html /// </summary> /// <typeparam name="T">The type used to infer the default index and typename</typeparam> /// <param name="client"></param> /// <param name="ids">IEnumerable of ids as ints for the documents to fetch</param> /// <param name="index">Optionally override the default inferred index name for T</param> /// <param name="type">Optionally overiide the default inferred typename for T</param> public static Task <IEnumerable <IMultiGetHit <T> > > GetManyAsync <T>( this IElasticClient client, IEnumerable <long> ids, IndexName index = null, TypeName type = null, CancellationToken cancellationToken = default(CancellationToken) ) where T : class => client.GetManyAsync <T>(ids.Select(i => i.ToString(CultureInfo.InvariantCulture)), index, type, cancellationToken);
/// <inheritdoc cref="PauseFollowIndex(IndexName, System.Func{Nest6.PauseFollowIndexDescriptor,Nest6.IPauseFollowIndexRequest})" /> public IPauseFollowIndexResponse PauseFollowIndex(IndexName index, Func <PauseFollowIndexDescriptor, IPauseFollowIndexRequest> selector = null) => PauseFollowIndex(selector.InvokeOrDefault(new PauseFollowIndexDescriptor(index)));
/// <summary> /// Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing). /// The response includes a docs array with all the fetched documents, each element similar in structure to a document /// provided by the get API. /// <para> </para> /// >http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html /// </summary> /// <typeparam name="T">The type used to infer the default index and typename</typeparam> /// <param name="client"></param> /// <param name="ids">IEnumerable of ids as string for the documents to fetch</param> /// <param name="index">Optionally override the default inferred index name for T</param> /// <param name="type">Optionally overiide the default inferred typename for T</param> public static IEnumerable <IMultiGetHit <T> > GetMany <T>(this IElasticClient client, IEnumerable <string> ids, IndexName index = null, TypeName type = null ) where T : class { var result = client.MultiGet(s => s .RequestConfiguration(r => r.ThrowExceptions()) .GetMany <T>(ids) .Index(index) .Type(type) ); return(result.GetMany <T>(ids)); }
/// <summary> /// Multi GET API allows to get multiple documents based on an index, type (optional) and id (and possibly routing). /// The response includes a docs array with all the fetched documents, each element similar in structure to a document /// provided by the get API. /// <para> </para> /// >http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-multi-get.html /// </summary> /// <typeparam name="T">The type used to infer the default index and typename</typeparam> /// <param name="client"></param> /// <param name="ids">IEnumerable of ids as ints for the documents to fetch</param> /// <param name="index">Optionally override the default inferred index name for T</param> /// <param name="type">Optionally overiide the default inferred typename for T</param> public static IEnumerable <IMultiGetHit <T> > GetMany <T>(this IElasticClient client, IEnumerable <long> ids, IndexName index = null, TypeName type = null ) where T : class => client.GetMany <T>(ids.Select(i => i.ToString(CultureInfo.InvariantCulture)), index, type);
/// <inheritdoc cref="MoveToStep(Nest6.IndexName,System.Func{Nest6.MoveToStepDescriptor,Nest6.IMoveToStepRequest})" /> public Task <IMoveToStepResponse> MoveToStepAsync(IndexName index, Func <MoveToStepDescriptor, IMoveToStepRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken) ) => MoveToStepAsync(selector.InvokeOrDefault(new MoveToStepDescriptor(index)), cancellationToken);
/// <inheritdoc cref="MoveToStep(Nest6.IndexName,System.Func{Nest6.MoveToStepDescriptor,Nest6.IMoveToStepRequest})" /> public IMoveToStepResponse MoveToStep(IndexName index, Func <MoveToStepDescriptor, IMoveToStepRequest> selector = null) => MoveToStep(selector.InvokeOrDefault(new MoveToStepDescriptor(index)));
public TDescriptor Index(IndexName index) => Assign(index, (a, v) => a.Index = v);
/// <inheritdoc cref="CreateFollowIndex(IndexName, System.Func{Nest6.CreateFollowIndexDescriptor,Nest6.ICreateFollowIndexRequest})" /> public ICreateFollowIndexResponse CreateFollowIndex(IndexName index, Func <CreateFollowIndexDescriptor, ICreateFollowIndexRequest> selector) => CreateFollowIndex(selector.InvokeOrDefault(new CreateFollowIndexDescriptor(index)));
/// <inheritdoc cref="PauseFollowIndex(IndexName, System.Func{Nest6.PauseFollowIndexDescriptor,Nest6.IPauseFollowIndexRequest})" /> public Task <IPauseFollowIndexResponse> PauseFollowIndexAsync( IndexName index, Func <PauseFollowIndexDescriptor, IPauseFollowIndexRequest> selector = null, CancellationToken cancellationToken = default ) => PauseFollowIndexAsync(selector.InvokeOrDefault(new PauseFollowIndexDescriptor(index)), cancellationToken);
/// <inheritdoc cref="CreateFollowIndex(IndexName, System.Func{Nest6.CreateFollowIndexDescriptor,Nest6.ICreateFollowIndexRequest})" /> public Task <ICreateFollowIndexResponse> CreateFollowIndexAsync(IndexName index, Func <CreateFollowIndexDescriptor, ICreateFollowIndexRequest> selector, CancellationToken cancellationToken = default ) => CreateFollowIndexAsync(selector.InvokeOrDefault(new CreateFollowIndexDescriptor(index)), cancellationToken);
/// <summary> /// Shortcut into the Bulk call that deletes the specified objects /// <para> </para> /// http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html /// </summary> /// <param name="client"></param> /// <typeparam name="T">The type used to infer the default index and typename</typeparam> /// <param name="objects">List of objects to delete</param> /// <param name="index">Override the inferred indexname for T</param> /// <param name="type">Override the inferred typename for T</param> public static IBulkResponse DeleteMany <T>(this IElasticClient client, IEnumerable <T> @objects, IndexName index = null, TypeName type = null) where T : class { var bulkRequest = CreateDeleteBulkRequest(objects, index, type); return(client.Bulk(bulkRequest)); }
internal static bool IsNullOrEmpty(this IndexName value) => value == null || value.GetHashCode() == 0;
/// <summary> /// Shortcut into the Bulk call that deletes the specified objects /// <para> </para> /// http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-bulk.html /// </summary> /// <param name="client"></param> /// <typeparam name="T">The type used to infer the default index and typename</typeparam> /// <param name="objects">List of objects to delete</param> /// <param name="index">Override the inferred indexname for T</param> /// <param name="type">Override the inferred typename for T</param> public static Task <IBulkResponse> DeleteManyAsync <T>(this IElasticClient client, IEnumerable <T> objects, IndexName index = null, TypeName type = null, CancellationToken cancellationToken = default(CancellationToken) ) where T : class { var bulkRequest = CreateDeleteBulkRequest(objects, index, type); return(client.BulkAsync(bulkRequest, cancellationToken)); }
/// <inheritdoc cref="GetRollupIndexCapabilities(IndexName, System.Func{Nest6.GetRollupIndexCapabilitiesDescriptor,Nest6.IGetRollupIndexCapabilitiesRequest})" /> public Task <IGetRollupIndexCapabilitiesResponse> GetRollupIndexCapabilitiesAsync( IndexName index, Func <GetRollupIndexCapabilitiesDescriptor, IGetRollupIndexCapabilitiesRequest> selector = null, CancellationToken cancellationToken = default ) => GetRollupIndexCapabilitiesAsync(selector.InvokeOrDefault(new GetRollupIndexCapabilitiesDescriptor(index)), cancellationToken);
private static BulkRequest CreateDeleteBulkRequest <T>(IEnumerable <T> objects, IndexName index, TypeName type) where T : class { @objects.ThrowIfEmpty(nameof(objects)); var bulkRequest = new BulkRequest(index, type); var deletes = @objects .Select(o => new BulkDeleteOperation <T>(o)) .Cast <IBulkOperation>() .ToList(); bulkRequest.Operations = deletes; return(bulkRequest); }
/// <inheritdoc /> public ISplitIndexResponse SplitIndex(IndexName source, IndexName target, Func <SplitIndexDescriptor, ISplitIndexRequest> selector = null) => SplitIndex(selector.InvokeOrDefault(new SplitIndexDescriptor(source, target)));
/// <inheritdoc cref="RetryIlm(Nest6.IndexName,System.Func{Nest6.RetryIlmDescriptor,Nest6.IRetryIlmRequest})" /> public IRetryIlmResponse RetryIlm(IndexName index, Func <RetryIlmDescriptor, IRetryIlmRequest> selector = null) => RetryIlm(selector.InvokeOrDefault(new RetryIlmDescriptor(index)));
public AliasRemoveIndexDescriptor Index(IndexName index) { Self.RemoveIndex.Index = index; return(this); }
public AnalyzeRequest(IndexName indices, string textToAnalyze) : this(indices) => Text = new[] { textToAnalyze };