/// <summary> /// Determines whether or not the given indexer exists in the Azure Search service. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Search.IIndexerOperations. /// </param> /// <param name="indexerName"> /// The name of the indexer. /// </param> /// <returns> /// <c>true</c> if the indexer exists; <c>false</c> otherwise. /// </returns> public static bool Exists(this IIndexerOperations operations, string indexerName) { return(Task.Factory.StartNew((object s) => { return ((IIndexerOperations)s).ExistsAsync(indexerName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Creates a new Azure Search indexer. (see /// https://msdn.microsoft.com/library/azure/dn946899.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Search.IIndexerOperations. /// </param> /// <param name='indexer'> /// Required. The definition of the indexer to create. /// </param> /// <returns> /// Response from a Create, Update, or Get Indexer request. If /// successful, it includes the full definition of the indexer that /// was created, updated, or retrieved. /// </returns> public static IndexerDefinitionResponse Create(this IIndexerOperations operations, Indexer indexer) { return(Task.Factory.StartNew((object s) => { return ((IIndexerOperations)s).CreateAsync(indexer); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the SearchServiceClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> private SearchServiceClient(HttpClient httpClient) : base(httpClient) { this._dataSources = new DataSourceOperations(this); this._indexers = new IndexerOperations(this); this._indexes = new IndexOperations(this); this._apiVersion = "2015-02-28"; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Determines whether or not the given indexer exists in the Azure Search service. /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Search.IIndexerOperations. /// </param> /// <param name="indexerName"> /// The name of the indexer. /// </param> /// <returns> /// <c>true</c> if the indexer exists; <c>false</c> otherwise. /// </returns> public static Task <bool> ExistsAsync(this IIndexerOperations operations, string indexerName) { return(operations.ExistsAsync(indexerName, CancellationToken.None)); }
/// <summary> /// Creates a new Azure Search indexer. (see /// https://msdn.microsoft.com/library/azure/dn946899.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Search.IIndexerOperations. /// </param> /// <param name='indexer'> /// Required. The definition of the indexer to create. /// </param> /// <returns> /// Response from a Create, Update, or Get Indexer request. If /// successful, it includes the full definition of the indexer that /// was created, updated, or retrieved. /// </returns> public static Task <IndexerDefinitionResponse> CreateAsync(this IIndexerOperations operations, Indexer indexer) { return(operations.CreateAsync(indexer, CancellationToken.None)); }
/// <summary> /// Runs an Azure Search indexer on-demand. (see /// https://msdn.microsoft.com/library/azure/dn946885.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Search.IIndexerOperations. /// </param> /// <param name='indexerName'> /// Required. The name of the indexer to run. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> RunAsync(this IIndexerOperations operations, string indexerName) { return(operations.RunAsync(indexerName, CancellationToken.None)); }
/// <summary> /// Lists all datasources available for an Azure Search service. (see /// https://msdn.microsoft.com/library/azure/dn946883.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Search.IIndexerOperations. /// </param> /// <returns> /// Response from a List Indexers request. If successful, it includes /// the full definitions of all indexers. /// </returns> public static Task <IndexerListResponse> ListAsync(this IIndexerOperations operations) { return(operations.ListAsync(CancellationToken.None)); }
/// <summary> /// Returns the current status and execution history of an indexer. /// (see https://msdn.microsoft.com/library/azure/dn946884.aspx for /// more information) /// </summary> /// <param name='operations'> /// Reference to the Microsoft.Azure.Search.IIndexerOperations. /// </param> /// <param name='indexerName'> /// Required. The name of the indexer for which to retrieve status. /// </param> /// <returns> /// Current status and execution history of an indexer. /// </returns> public static Task <IndexerGetStatusResponse> GetStatusAsync(this IIndexerOperations operations, string indexerName) { return(operations.GetStatusAsync(indexerName, CancellationToken.None)); }