Skip to content

Commit

Permalink
Change Search version to use 2020-06-30 (#13008)
Browse files Browse the repository at this point in the history
* Change Search version to use 2020-06-30

Fixes #10873 to use a fixed version of the latest swaggers for Search.

* Update models and fix live tests

Required change after Azure/azure-rest-api-specs#9968. The live test was failing because we *sometimes* exhausted our free allocation of text translations.
  • Loading branch information
heaths authored Jun 26, 2020
1 parent eaaff6d commit bad91c4
Show file tree
Hide file tree
Showing 263 changed files with 5,303 additions and 18,307 deletions.
8 changes: 7 additions & 1 deletion sdk/search/Azure.Search.Documents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

## 11.0.0-preview.5 (Unreleased)

### Minor Changes
### Changed

- Changed version to 11.0.0.
- Removed preview version `SearchClientOptions.ServiceVersion.V2019_05_06_Preview`
and added version `SearchClientOptions.ServiceVersion.V2020_06_30`.

### Removed

- Removed `SearchServiceCounters.SkillsetCounter`.

## 1.0.0-preview.4 (2020-06-09)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ public SearchClient(System.Uri endpoint, string indexName, Azure.AzureKeyCredent
}
public partial class SearchClientOptions : Azure.Core.ClientOptions
{
public SearchClientOptions(Azure.Search.Documents.SearchClientOptions.ServiceVersion version = Azure.Search.Documents.SearchClientOptions.ServiceVersion.V2019_05_06_Preview) { }
public SearchClientOptions(Azure.Search.Documents.SearchClientOptions.ServiceVersion version = Azure.Search.Documents.SearchClientOptions.ServiceVersion.V2020_06_30) { }
public Azure.Search.Documents.SearchClientOptions.ServiceVersion Version { get { throw null; } }
public enum ServiceVersion
{
V2019_05_06_Preview = 1,
V2020_06_30 = 1,
}
}
public static partial class SearchFilter
Expand Down Expand Up @@ -1306,7 +1306,6 @@ internal SearchServiceCounters() { }
public Azure.Search.Documents.Indexes.Models.SearchResourceCounter DocumentCounter { get { throw null; } }
public Azure.Search.Documents.Indexes.Models.SearchResourceCounter IndexCounter { get { throw null; } }
public Azure.Search.Documents.Indexes.Models.SearchResourceCounter IndexerCounter { get { throw null; } }
public Azure.Search.Documents.Indexes.Models.SearchResourceCounter SkillsetCounter { get { throw null; } }
public Azure.Search.Documents.Indexes.Models.SearchResourceCounter StorageSizeCounter { get { throw null; } }
public Azure.Search.Documents.Indexes.Models.SearchResourceCounter SynonymMapCounter { get { throw null; } }
}
Expand Down Expand Up @@ -1999,7 +1998,7 @@ public static partial class SearchModelFactory
public static Azure.Search.Documents.Models.SearchResultsPage<T> SearchResultsPage<T>(Azure.Search.Documents.Models.SearchResults<T> results) { throw null; }
public static Azure.Search.Documents.Models.SearchResults<T> SearchResults<T>(System.Collections.Generic.IEnumerable<Azure.Search.Documents.Models.SearchResult<T>> values, long? totalCount, System.Collections.Generic.IDictionary<string, System.Collections.Generic.IList<Azure.Search.Documents.Models.FacetResult>> facets, double? coverage, Azure.Response rawResponse) { throw null; }
public static Azure.Search.Documents.Models.SearchResult<T> SearchResult<T>(T document, double? score, System.Collections.Generic.IDictionary<string, System.Collections.Generic.IList<string>> highlights) { throw null; }
public static Azure.Search.Documents.Indexes.Models.SearchServiceCounters SearchServiceCounters(Azure.Search.Documents.Indexes.Models.SearchResourceCounter documentCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexerCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter dataSourceCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter storageSizeCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter synonymMapCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter skillsetCounter) { throw null; }
public static Azure.Search.Documents.Indexes.Models.SearchServiceCounters SearchServiceCounters(Azure.Search.Documents.Indexes.Models.SearchResourceCounter documentCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter indexerCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter dataSourceCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter storageSizeCounter, Azure.Search.Documents.Indexes.Models.SearchResourceCounter synonymMapCounter) { throw null; }
public static Azure.Search.Documents.Indexes.Models.SearchServiceLimits SearchServiceLimits(int? maxFieldsPerIndex, int? maxFieldNestingDepthPerIndex, int? maxComplexCollectionFieldsPerIndex, int? maxComplexObjectsInCollectionsPerDocument) { throw null; }
public static Azure.Search.Documents.Indexes.Models.SearchServiceStatistics SearchServiceStatistics(Azure.Search.Documents.Indexes.Models.SearchServiceCounters counters, Azure.Search.Documents.Indexes.Models.SearchServiceLimits limits) { throw null; }
public static Azure.Search.Documents.Models.SearchSuggestion<T> SearchSuggestion<T>(T document, string text) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ SearchIndexerSkillset skillset = new SearchIndexerSkillset(
skillsetName,
new SearchIndexerSkill[] { translationSkill, conditionalSkill })
{
CognitiveServicesAccount = new CognitiveServicesAccountKey(Environment.GetEnvironmentVariable("COGNITIVE_KEY"))
CognitiveServicesAccount = new CognitiveServicesAccountKey(
Environment.GetEnvironmentVariable("COGNITIVE_SERVICES_KEY"))
};

await indexerClient.CreateSkillsetAsync(skillset);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,15 @@ public static SearchResourceCounter SearchResourceCounter(
/// <param name="dataSourceCounter"> Total number of data sources. </param>
/// <param name="storageSizeCounter"> Total size of used storage in bytes. </param>
/// <param name="synonymMapCounter"> Total number of synonym maps. </param>
/// <param name="skillsetCounter"> Total number of skillsets. </param>
/// <returns> A new SearchServiceCounters instance for mocking. </returns>
public static SearchServiceCounters SearchServiceCounters(
SearchResourceCounter documentCounter,
SearchResourceCounter indexCounter,
SearchResourceCounter indexerCounter,
SearchResourceCounter dataSourceCounter,
SearchResourceCounter storageSizeCounter,
SearchResourceCounter synonymMapCounter,
SearchResourceCounter skillsetCounter) =>
new SearchServiceCounters(documentCounter, indexCounter, indexerCounter, dataSourceCounter, storageSizeCounter, synonymMapCounter, skillsetCounter);
SearchResourceCounter synonymMapCounter) =>
new SearchServiceCounters(documentCounter, indexCounter, indexerCounter, dataSourceCounter, storageSizeCounter, synonymMapCounter);

/// <summary> Initializes a new instance of SearchServiceLimits. </summary>
/// <param name="maxFieldsPerIndex"> The maximum allowed fields per index. </param>
Expand Down
2 changes: 1 addition & 1 deletion sdk/search/Azure.Search.Documents/src/SearchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ internal SearchClient(
Debug.Assert(pipeline != null);
Debug.Assert(diagnostics != null);
Debug.Assert(
SearchClientOptions.ServiceVersion.V2019_05_06_Preview <= version &&
SearchClientOptions.ServiceVersion.V2020_06_30 <= version &&
version <= SearchClientOptions.LatestVersion);

Endpoint = endpoint;
Expand Down
12 changes: 6 additions & 6 deletions sdk/search/Azure.Search.Documents/src/SearchClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ public enum ServiceVersion
{
#pragma warning disable CA1707 // Identifiers should not contain underscores
/// <summary>
/// The 2019-05-06-Preview version of the Azure Cognitive Search
/// The 2020_06_30 version of the Azure Cognitive Search
/// service.
/// </summary>
V2019_05_06_Preview = 1
V2020_06_30 = 1
#pragma warning restore CA1707
}

/// <summary>
/// The Latest service version supported by this client library.
/// </summary>
internal const ServiceVersion LatestVersion = ServiceVersion.V2019_05_06_Preview;
internal const ServiceVersion LatestVersion = ServiceVersion.V2020_06_30;

/// <summary>
/// The service version to use when creating continuation tokens that
/// can be passed between different client libraries. Changing this
/// value requires updating <see cref="Azure.Search.Documents.Models.SearchContinuationToken"/>.
/// </summary>
internal const ServiceVersion ContinuationTokenVersion = ServiceVersion.V2019_05_06_Preview;
internal const ServiceVersion ContinuationTokenVersion = ServiceVersion.V2020_06_30;

/// <summary>
/// Gets the <see cref="ServiceVersion"/> of the service API used when
Expand Down Expand Up @@ -164,7 +164,7 @@ internal static partial class SearchExtensions
public static SearchClientOptions.ServiceVersion Validate(this SearchClientOptions.ServiceVersion version) =>
version switch
{
SearchClientOptions.ServiceVersion.V2019_05_06_Preview => version,
SearchClientOptions.ServiceVersion.V2020_06_30 => version,
_ => throw CreateInvalidVersionException(version)
};

Expand All @@ -186,7 +186,7 @@ public static SearchClientOptions.ServiceVersion Validate(this SearchClientOptio
public static string ToVersionString(this SearchClientOptions.ServiceVersion version) =>
version switch
{
SearchClientOptions.ServiceVersion.V2019_05_06_Preview => "2019-05-06-Preview",
SearchClientOptions.ServiceVersion.V2020_06_30 => "2020-06-30",
_ => throw CreateInvalidVersionException(version)
};

Expand Down
4 changes: 2 additions & 2 deletions sdk/search/Azure.Search.Documents/src/autorest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ we should merge the Service and Index swagger files together but for now we
copy them locally in `/sdk/search/generate.ps1` and reference them here.
```yaml
input-file:
- $(this-folder)/swagger/searchindex.json
- $(this-folder)/swagger/searchservice.json
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0bc7853cb4d824bb6c310344dcc1b5f77cbe6bdd/specification/search/data-plane/Azure.Search/preview/2020-06-30/searchindex.json
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/0bc7853cb4d824bb6c310344dcc1b5f77cbe6bdd/specification/search/data-plane/Azure.Search/preview/2020-06-30/searchservice.json
```
## Release hacks
Expand Down
Loading

0 comments on commit bad91c4

Please sign in to comment.