| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.Search |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Azure; |
| | 15 | | using Models; |
| | 16 | | using System.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for IndexesOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class IndexesOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Creates a new search index. |
| | 26 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/create-index">Cre |
| | 27 | | /// </summary> |
| | 28 | | /// <param name='operations'> |
| | 29 | | /// The operations group for this extension method. |
| | 30 | | /// </param> |
| | 31 | | /// <param name='index'> |
| | 32 | | /// The definition of the index to create. |
| | 33 | | /// </param> |
| | 34 | | /// <param name='searchRequestOptions'> |
| | 35 | | /// Additional parameters for the operation |
| | 36 | | /// </param> |
| | 37 | | public static Index Create(this IIndexesOperations operations, Index index, SearchRequestOptions searchReque |
| | 38 | | { |
| 548 | 39 | | return operations.CreateAsync(index, searchRequestOptions).GetAwaiter().GetResult(); |
| | 40 | | } |
| | 41 | |
|
| | 42 | | /// <summary> |
| | 43 | | /// Creates a new search index. |
| | 44 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/create-index">Cre |
| | 45 | | /// </summary> |
| | 46 | | /// <param name='operations'> |
| | 47 | | /// The operations group for this extension method. |
| | 48 | | /// </param> |
| | 49 | | /// <param name='index'> |
| | 50 | | /// The definition of the index to create. |
| | 51 | | /// </param> |
| | 52 | | /// <param name='searchRequestOptions'> |
| | 53 | | /// Additional parameters for the operation |
| | 54 | | /// </param> |
| | 55 | | /// <param name='cancellationToken'> |
| | 56 | | /// The cancellation token. |
| | 57 | | /// </param> |
| | 58 | | public static async Task<Index> CreateAsync(this IIndexesOperations operations, Index index, SearchRequestOp |
| | 59 | | { |
| 548 | 60 | | using (var _result = await operations.CreateWithHttpMessagesAsync(index, searchRequestOptions, null, can |
| | 61 | | { |
| 546 | 62 | | return _result.Body; |
| | 63 | | } |
| 546 | 64 | | } |
| | 65 | |
|
| | 66 | | /// <summary> |
| | 67 | | /// Lists all indexes available for a search service. |
| | 68 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/list-indexes">Lis |
| | 69 | | /// </summary> |
| | 70 | | /// <param name='operations'> |
| | 71 | | /// The operations group for this extension method. |
| | 72 | | /// </param> |
| | 73 | | /// <param name='select'> |
| | 74 | | /// Selects which properties of the index definitions to retrieve. Specified as |
| | 75 | | /// a comma-separated list of JSON property names, or '*' for all properties. |
| | 76 | | /// The default is all properties. |
| | 77 | | /// </param> |
| | 78 | | /// <param name='searchRequestOptions'> |
| | 79 | | /// Additional parameters for the operation |
| | 80 | | /// </param> |
| | 81 | | public static IndexListResult List(this IIndexesOperations operations, string select = default(string), Sear |
| | 82 | | { |
| 4 | 83 | | return operations.ListAsync(select, searchRequestOptions).GetAwaiter().GetResult(); |
| | 84 | | } |
| | 85 | |
|
| | 86 | | /// <summary> |
| | 87 | | /// Lists all indexes available for a search service. |
| | 88 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/list-indexes">Lis |
| | 89 | | /// </summary> |
| | 90 | | /// <param name='operations'> |
| | 91 | | /// The operations group for this extension method. |
| | 92 | | /// </param> |
| | 93 | | /// <param name='select'> |
| | 94 | | /// Selects which properties of the index definitions to retrieve. Specified as |
| | 95 | | /// a comma-separated list of JSON property names, or '*' for all properties. |
| | 96 | | /// The default is all properties. |
| | 97 | | /// </param> |
| | 98 | | /// <param name='searchRequestOptions'> |
| | 99 | | /// Additional parameters for the operation |
| | 100 | | /// </param> |
| | 101 | | /// <param name='cancellationToken'> |
| | 102 | | /// The cancellation token. |
| | 103 | | /// </param> |
| | 104 | | public static async Task<IndexListResult> ListAsync(this IIndexesOperations operations, string select = defa |
| | 105 | | { |
| 4 | 106 | | using (var _result = await operations.ListWithHttpMessagesAsync(select, searchRequestOptions, null, canc |
| | 107 | | { |
| 4 | 108 | | return _result.Body; |
| | 109 | | } |
| 4 | 110 | | } |
| | 111 | |
|
| | 112 | | /// <summary> |
| | 113 | | /// Creates a new search index or updates an index if it already exists. |
| | 114 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/update-index">Upd |
| | 115 | | /// </summary> |
| | 116 | | /// <param name='operations'> |
| | 117 | | /// The operations group for this extension method. |
| | 118 | | /// </param> |
| | 119 | | /// <param name='indexName'> |
| | 120 | | /// The definition of the index to create or update. |
| | 121 | | /// </param> |
| | 122 | | /// <param name='index'> |
| | 123 | | /// The definition of the index to create or update. |
| | 124 | | /// </param> |
| | 125 | | /// <param name='allowIndexDowntime'> |
| | 126 | | /// Allows new analyzers, tokenizers, token filters, or char filters to be |
| | 127 | | /// added to an index by taking the index offline for at least a few seconds. |
| | 128 | | /// This temporarily causes indexing and query requests to fail. Performance |
| | 129 | | /// and write availability of the index can be impaired for several minutes |
| | 130 | | /// after the index is updated, or longer for very large indexes. |
| | 131 | | /// </param> |
| | 132 | | /// <param name='searchRequestOptions'> |
| | 133 | | /// Additional parameters for the operation |
| | 134 | | /// </param> |
| | 135 | | /// <param name='accessCondition'> |
| | 136 | | /// Additional parameters for the operation |
| | 137 | | /// </param> |
| | 138 | | public static Index CreateOrUpdate(this IIndexesOperations operations, string indexName, Index index, bool? |
| | 139 | | { |
| 0 | 140 | | return operations.CreateOrUpdateAsync(indexName, index, allowIndexDowntime, searchRequestOptions, access |
| | 141 | | } |
| | 142 | |
|
| | 143 | | /// <summary> |
| | 144 | | /// Creates a new search index or updates an index if it already exists. |
| | 145 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/update-index">Upd |
| | 146 | | /// </summary> |
| | 147 | | /// <param name='operations'> |
| | 148 | | /// The operations group for this extension method. |
| | 149 | | /// </param> |
| | 150 | | /// <param name='indexName'> |
| | 151 | | /// The definition of the index to create or update. |
| | 152 | | /// </param> |
| | 153 | | /// <param name='index'> |
| | 154 | | /// The definition of the index to create or update. |
| | 155 | | /// </param> |
| | 156 | | /// <param name='allowIndexDowntime'> |
| | 157 | | /// Allows new analyzers, tokenizers, token filters, or char filters to be |
| | 158 | | /// added to an index by taking the index offline for at least a few seconds. |
| | 159 | | /// This temporarily causes indexing and query requests to fail. Performance |
| | 160 | | /// and write availability of the index can be impaired for several minutes |
| | 161 | | /// after the index is updated, or longer for very large indexes. |
| | 162 | | /// </param> |
| | 163 | | /// <param name='searchRequestOptions'> |
| | 164 | | /// Additional parameters for the operation |
| | 165 | | /// </param> |
| | 166 | | /// <param name='accessCondition'> |
| | 167 | | /// Additional parameters for the operation |
| | 168 | | /// </param> |
| | 169 | | /// <param name='cancellationToken'> |
| | 170 | | /// The cancellation token. |
| | 171 | | /// </param> |
| | 172 | | public static async Task<Index> CreateOrUpdateAsync(this IIndexesOperations operations, string indexName, In |
| | 173 | | { |
| 0 | 174 | | using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(indexName, index, allowIndexDo |
| | 175 | | { |
| 0 | 176 | | return _result.Body; |
| | 177 | | } |
| 0 | 178 | | } |
| | 179 | |
|
| | 180 | | /// <summary> |
| | 181 | | /// Deletes a search index and all the documents it contains. |
| | 182 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/delete-index">Del |
| | 183 | | /// </summary> |
| | 184 | | /// <param name='operations'> |
| | 185 | | /// The operations group for this extension method. |
| | 186 | | /// </param> |
| | 187 | | /// <param name='indexName'> |
| | 188 | | /// The name of the index to delete. |
| | 189 | | /// </param> |
| | 190 | | /// <param name='searchRequestOptions'> |
| | 191 | | /// Additional parameters for the operation |
| | 192 | | /// </param> |
| | 193 | | /// <param name='accessCondition'> |
| | 194 | | /// Additional parameters for the operation |
| | 195 | | /// </param> |
| | 196 | | public static void Delete(this IIndexesOperations operations, string indexName, SearchRequestOptions searchR |
| | 197 | | { |
| 36 | 198 | | operations.DeleteAsync(indexName, searchRequestOptions, accessCondition).GetAwaiter().GetResult(); |
| 32 | 199 | | } |
| | 200 | |
|
| | 201 | | /// <summary> |
| | 202 | | /// Deletes a search index and all the documents it contains. |
| | 203 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/delete-index">Del |
| | 204 | | /// </summary> |
| | 205 | | /// <param name='operations'> |
| | 206 | | /// The operations group for this extension method. |
| | 207 | | /// </param> |
| | 208 | | /// <param name='indexName'> |
| | 209 | | /// The name of the index to delete. |
| | 210 | | /// </param> |
| | 211 | | /// <param name='searchRequestOptions'> |
| | 212 | | /// Additional parameters for the operation |
| | 213 | | /// </param> |
| | 214 | | /// <param name='accessCondition'> |
| | 215 | | /// Additional parameters for the operation |
| | 216 | | /// </param> |
| | 217 | | /// <param name='cancellationToken'> |
| | 218 | | /// The cancellation token. |
| | 219 | | /// </param> |
| | 220 | | public static async Task DeleteAsync(this IIndexesOperations operations, string indexName, SearchRequestOpti |
| | 221 | | { |
| 36 | 222 | | (await operations.DeleteWithHttpMessagesAsync(indexName, searchRequestOptions, accessCondition, null, ca |
| 32 | 223 | | } |
| | 224 | |
|
| | 225 | | /// <summary> |
| | 226 | | /// Retrieves an index definition. |
| | 227 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/get-index">Get In |
| | 228 | | /// </summary> |
| | 229 | | /// <param name='operations'> |
| | 230 | | /// The operations group for this extension method. |
| | 231 | | /// </param> |
| | 232 | | /// <param name='indexName'> |
| | 233 | | /// The name of the index to retrieve. |
| | 234 | | /// </param> |
| | 235 | | /// <param name='searchRequestOptions'> |
| | 236 | | /// Additional parameters for the operation |
| | 237 | | /// </param> |
| | 238 | | public static Index Get(this IIndexesOperations operations, string indexName, SearchRequestOptions searchReq |
| | 239 | | { |
| 16 | 240 | | return operations.GetAsync(indexName, searchRequestOptions).GetAwaiter().GetResult(); |
| | 241 | | } |
| | 242 | |
|
| | 243 | | /// <summary> |
| | 244 | | /// Retrieves an index definition. |
| | 245 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/get-index">Get In |
| | 246 | | /// </summary> |
| | 247 | | /// <param name='operations'> |
| | 248 | | /// The operations group for this extension method. |
| | 249 | | /// </param> |
| | 250 | | /// <param name='indexName'> |
| | 251 | | /// The name of the index to retrieve. |
| | 252 | | /// </param> |
| | 253 | | /// <param name='searchRequestOptions'> |
| | 254 | | /// Additional parameters for the operation |
| | 255 | | /// </param> |
| | 256 | | /// <param name='cancellationToken'> |
| | 257 | | /// The cancellation token. |
| | 258 | | /// </param> |
| | 259 | | public static async Task<Index> GetAsync(this IIndexesOperations operations, string indexName, SearchRequest |
| | 260 | | { |
| 16 | 261 | | using (var _result = await operations.GetWithHttpMessagesAsync(indexName, searchRequestOptions, null, ca |
| | 262 | | { |
| 14 | 263 | | return _result.Body; |
| | 264 | | } |
| 14 | 265 | | } |
| | 266 | |
|
| | 267 | | /// <summary> |
| | 268 | | /// Returns statistics for the given index, including a document count and |
| | 269 | | /// storage usage. |
| | 270 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/get-index-statist |
| | 271 | | /// </summary> |
| | 272 | | /// <param name='operations'> |
| | 273 | | /// The operations group for this extension method. |
| | 274 | | /// </param> |
| | 275 | | /// <param name='indexName'> |
| | 276 | | /// The name of the index for which to retrieve statistics. |
| | 277 | | /// </param> |
| | 278 | | /// <param name='searchRequestOptions'> |
| | 279 | | /// Additional parameters for the operation |
| | 280 | | /// </param> |
| | 281 | | public static IndexGetStatisticsResult GetStatistics(this IIndexesOperations operations, string indexName, S |
| | 282 | | { |
| 2 | 283 | | return operations.GetStatisticsAsync(indexName, searchRequestOptions).GetAwaiter().GetResult(); |
| | 284 | | } |
| | 285 | |
|
| | 286 | | /// <summary> |
| | 287 | | /// Returns statistics for the given index, including a document count and |
| | 288 | | /// storage usage. |
| | 289 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/get-index-statist |
| | 290 | | /// </summary> |
| | 291 | | /// <param name='operations'> |
| | 292 | | /// The operations group for this extension method. |
| | 293 | | /// </param> |
| | 294 | | /// <param name='indexName'> |
| | 295 | | /// The name of the index for which to retrieve statistics. |
| | 296 | | /// </param> |
| | 297 | | /// <param name='searchRequestOptions'> |
| | 298 | | /// Additional parameters for the operation |
| | 299 | | /// </param> |
| | 300 | | /// <param name='cancellationToken'> |
| | 301 | | /// The cancellation token. |
| | 302 | | /// </param> |
| | 303 | | public static async Task<IndexGetStatisticsResult> GetStatisticsAsync(this IIndexesOperations operations, st |
| | 304 | | { |
| 2 | 305 | | using (var _result = await operations.GetStatisticsWithHttpMessagesAsync(indexName, searchRequestOptions |
| | 306 | | { |
| 2 | 307 | | return _result.Body; |
| | 308 | | } |
| 2 | 309 | | } |
| | 310 | |
|
| | 311 | | /// <summary> |
| | 312 | | /// Shows how an analyzer breaks text into tokens. |
| | 313 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/test-analyzer">An |
| | 314 | | /// </summary> |
| | 315 | | /// <param name='operations'> |
| | 316 | | /// The operations group for this extension method. |
| | 317 | | /// </param> |
| | 318 | | /// <param name='indexName'> |
| | 319 | | /// The name of the index for which to test an analyzer. |
| | 320 | | /// </param> |
| | 321 | | /// <param name='request'> |
| | 322 | | /// The text and analyzer or analysis components to test. |
| | 323 | | /// </param> |
| | 324 | | /// <param name='searchRequestOptions'> |
| | 325 | | /// Additional parameters for the operation |
| | 326 | | /// </param> |
| | 327 | | public static AnalyzeResult Analyze(this IIndexesOperations operations, string indexName, AnalyzeRequest req |
| | 328 | | { |
| 218 | 329 | | return operations.AnalyzeAsync(indexName, request, searchRequestOptions).GetAwaiter().GetResult(); |
| | 330 | | } |
| | 331 | |
|
| | 332 | | /// <summary> |
| | 333 | | /// Shows how an analyzer breaks text into tokens. |
| | 334 | | /// For more information, see <see href="https://docs.microsoft.com/rest/api/searchservice/test-analyzer">An |
| | 335 | | /// </summary> |
| | 336 | | /// <param name='operations'> |
| | 337 | | /// The operations group for this extension method. |
| | 338 | | /// </param> |
| | 339 | | /// <param name='indexName'> |
| | 340 | | /// The name of the index for which to test an analyzer. |
| | 341 | | /// </param> |
| | 342 | | /// <param name='request'> |
| | 343 | | /// The text and analyzer or analysis components to test. |
| | 344 | | /// </param> |
| | 345 | | /// <param name='searchRequestOptions'> |
| | 346 | | /// Additional parameters for the operation |
| | 347 | | /// </param> |
| | 348 | | /// <param name='cancellationToken'> |
| | 349 | | /// The cancellation token. |
| | 350 | | /// </param> |
| | 351 | | public static async Task<AnalyzeResult> AnalyzeAsync(this IIndexesOperations operations, string indexName, A |
| | 352 | | { |
| 218 | 353 | | using (var _result = await operations.AnalyzeWithHttpMessagesAsync(indexName, request, searchRequestOpti |
| | 354 | | { |
| 218 | 355 | | return _result.Body; |
| | 356 | | } |
| 218 | 357 | | } |
| | 358 | |
|
| | 359 | | } |
| | 360 | | } |