[Azure Search] SDK for Autocomplete#4338
Conversation
The Autocomplete tests needed to be re-recorded since they were orginally recorded for an older api-version (2016-09-01-Preview). SearchTests needed to be re-recorded because the test data changed as part of implementing the Autocomplete tests.
|
@mhko Please fix test failures |
|
@mhko It looks like you forgot to add the new SessionRecords that you recorded for the Autocomplete tests. Always make sure that tests pass in Playback mode before submitting a PR. |
|
@mhko Please always include [Azure Search] in your commit messages |
| /// highlighting is disabled.</param> | ||
| /// <param name="minimumCoverage">A number between 0 and 100 indicating | ||
| /// the percentage of the index that must be covered by a suggestion | ||
| /// the percentage of the index that must be covered by am autocomplete |
There was a problem hiding this comment.
am autocomplete -> an autocomplete
| /// <summary> | ||
| /// Gets or sets the comma-separated list of field names to consider | ||
| /// when querying for suggestions. | ||
| /// when querying for autucompleted terms. |
There was a problem hiding this comment.
autucompleted -> auto-completed
There was a problem hiding this comment.
Thanks. Fixed in the swagger spec.
| string suggesterName, | ||
| SearchRequestOptions searchRequestOptions = default(SearchRequestOptions), | ||
| AutocompleteParametersPayload autocompleteParametersPayload = null, | ||
| AutocompleteParameters autocompleteParametersPayload = null, |
There was a problem hiding this comment.
The parameter shouldn't have "payload" in the name
| else | ||
| { | ||
| string searchFieldsStr = null; | ||
| if (autocompleteParameters != null && autocompleteParameters.SearchFields != null) |
There was a problem hiding this comment.
nit: You can shorten this to if (autocompleteParameters?.SearchFields != null)
| if (searchFields != null) | ||
| { | ||
| _queryParameters.Add(string.Format("searchFields={0}", System.Uri.EscapeDataString(searchFields))); | ||
| _queryParameters.Add(string.Format("searchFields={0}", System.Uri.EscapeDataString(string.Join(",", searchFields)))); |
There was a problem hiding this comment.
Wow, AutoRest understands comma-separated parameters? That's pretty cool!
| "Entries": [ | ||
| { | ||
| "RequestUri": "/subscriptions/3c729b2a-4f86-4bb2-abe8-4b8647af156c/resourceGroups/azsmnet4511/providers/Microsoft.Search/searchServices/azs-7938?api-version=2015-08-19", | ||
| "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvM2M3MjliMmEtNGY4Ni00YmIyLWFiZTgtNGI4NjQ3YWYxNTZjL3Jlc291cmNlR3JvdXBzL2F6c21uZXQ0NTExL3Byb3ZpZGVycy9NaWNyb3NvZnQuU2VhcmNoL3NlYXJjaFNlcnZpY2VzL2F6cy03OTM4P2FwaS12ZXJzaW9uPTIwMTUtMDgtMTk=", |
There was a problem hiding this comment.
This looks very wrong. There's only a call to ARM to delete the test search service.
There was a problem hiding this comment.
Thanks for noticing it. It looks like this session was recorded while refactoring was in progress. This test doesn't exist anymore.
| @@ -172,7 +172,7 @@ protected void TestAutocompleteWithSelectedFields() | |||
| SearchIndexClient client = GetClientForQuery(); | |||
| var autocompleteParameters = new AutocompleteParameters() | |||
| { | |||
| SearchFields = "hotelName" | |||
| SearchFields = new[] { "hotelName" } | |||
There was a problem hiding this comment.
We need tests with more than one search field.
|
@mhko This looks good. I'm going to go ahead and merge it, and you can submit another PR once the Swagger PR is merged and you're able to regenerate the code from the spec in Azure/master. |
@brjohnstmsft.
While the swagger spec for autocomplete is being reviewed (https://github.com/Azure/azure-rest-api-specs-pr/pull/473). I wanted to share this PR with you for early visibility. Once the PR on the swagger spec is reviewed and merged, I will regenerate this code from the spec the right way and update this PR.
Description
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
Testing Guidelines
SDK Generation Guidelines
*.csprojandAssemblyInfo.csfiles have been updated with the new version of the SDK.