diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceAsyncClient.java b/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceAsyncClient.java index 8d262f99719c8..514371406db94 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceAsyncClient.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceAsyncClient.java @@ -3,10 +3,13 @@ package com.azure.search; import com.azure.core.annotation.ServiceClient; +import com.azure.core.exception.HttpResponseException; import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpResponse; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.search.implementation.SearchServiceRestClientBuilder; @@ -343,7 +346,7 @@ public Mono createIndex(Index index) { /** * Creates a new Azure Cognitive Search index. * @param index definition of the index to create. - * @param searchRequestOptions Search Request Options. + * @param searchRequestOptions Additional parameters for the operation. * @return a response containing the created Index. */ public Mono> createIndexWithResponse(Index index, SearchRequestOptions searchRequestOptions) { @@ -360,19 +363,88 @@ Mono> createIndexWithResponse(Index index, } /** - * @throws NotImplementedException not implemented + * Retrieves an index definition from the Azure Cognitive Search. + * @param indexName The name of the index to retrieve * @return the Index. */ - public Mono getIndex() { - throw logger.logExceptionAsError(new NotImplementedException("not implemented.")); + public Mono getIndex(String indexName) { + return this.getIndexWithResponse(indexName, null) + .map(Response::getValue); } /** - * @throws NotImplementedException not implemented + * Retrieves an index definition from the Azure Cognitive Search. + * @param indexName The name of the index to retrieve + * @param searchRequestOptions Additional parameters for the operation. + * @return the Index. + */ + public Mono getIndex(String indexName, SearchRequestOptions searchRequestOptions) { + return this.getIndexWithResponse(indexName, searchRequestOptions) + .map(Response::getValue); + } + + /** + * Retrieves an index definition from the Azure Cognitive Search. + * @param indexName The name of the index to retrieve + * @param searchRequestOptions Additional parameters for the operation * @return a response containing the Index. */ - public Mono> getIndexWithResponse() { - throw logger.logExceptionAsError(new NotImplementedException("not implemented.")); + public Mono> getIndexWithResponse(String indexName, SearchRequestOptions searchRequestOptions) { + return withContext(context -> getIndexWithResponse(indexName, searchRequestOptions, context)); + } + + Mono> getIndexWithResponse(String indexName, + SearchRequestOptions searchRequestOptions, + Context context) { + return restClient + .indexes() + .getWithRestResponseAsync(indexName, searchRequestOptions, context) + .map(Function.identity()); + } + + /** + * Determines whether or not the given index exists in the Azure Cognitive Search. + * @param indexName The name of the index + * @return true if the index exists; false otherwise. + */ + public Mono indexExists(String indexName) { + return indexExistsWithResponse(indexName, null).map(Response::getValue); + } + + /** + * Determines whether or not the given index exists in the Azure Cognitive Search. + * @param indexName The name of the index + * @param searchRequestOptions Additional parameters for the operation. + * @return true if the index exists; false otherwise. + */ + public Mono indexExists(String indexName, SearchRequestOptions searchRequestOptions) { + return indexExistsWithResponse(indexName, searchRequestOptions).map(Response::getValue); + } + + /** + * Determines whether or not the given index exists in the Azure Cognitive Search. + * @param indexName The name of the index + * @param searchRequestOptions Additional parameters for the operation + * @return true if the index exists; false otherwise. + */ + public Mono> indexExistsWithResponse(String indexName, + SearchRequestOptions searchRequestOptions) { + return withContext(context -> indexExistsWithResponse(indexName, searchRequestOptions, context)); + } + + Mono> indexExistsWithResponse(String indexName, + SearchRequestOptions searchRequestOptions, + Context context) { + return this.getIndexWithResponse(indexName, searchRequestOptions, context) + .map(i -> (Response) new SimpleResponse<>(i, true)) + .onErrorResume( + t -> t instanceof HttpResponseException + && ((HttpResponseException) t).getResponse().getStatusCode() == 404, + t -> { + HttpResponse response = ((HttpResponseException) t).getResponse(); + return Mono.just(new SimpleResponse<>(response.getRequest(), response.getStatusCode(), + response.getHeaders(), false)); + }); } /** diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceClient.java b/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceClient.java index 293abd5c72b36..534540fff44af 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceClient.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/SearchServiceClient.java @@ -252,7 +252,7 @@ public Index createIndex(Index index) { /** * Creates a new Azure Cognitive Search index * @param index definition of the index to create - * @param searchRequestOptions Search Request Options + * @param searchRequestOptions Additional parameters for the operation. * @param context additional context that is passed through the Http pipeline during the service call * @return a response containing the created Index. */ @@ -263,18 +263,70 @@ public Response createIndexWithResponse(Index index, } /** - * @throws NotImplementedException not implemented + * Retrieves an index definition from the Azure Cognitive Search. + * @param indexName The name of the index to retrieve * @return the Index. */ - public Index getIndex() { - throw logger.logExceptionAsError(new NotImplementedException("not implemented.")); + public Index getIndex(String indexName) { + return this.getIndexWithResponse(indexName, null, Context.NONE).getValue(); } + + /** - * @throws NotImplementedException not implemented + * Retrieves an index definition from the Azure Cognitive Search. + * @param indexName The name of the index to retrieve + * @param searchRequestOptions Additional parameters for the operation. + * @return the Index. + */ + public Index getIndex(String indexName, + SearchRequestOptions searchRequestOptions) { + return this.getIndexWithResponse(indexName, searchRequestOptions, Context.NONE).getValue(); + } + + /** + * Retrieves an index definition from the Azure Cognitive Search. + * @param indexName The name of the index to retrieve + * @param searchRequestOptions Additional parameters for the operation + * @param context additional context that is passed through the Http pipeline during the service call * @return a response containing the Index. */ - public Response getIndexWithResponse() { - throw logger.logExceptionAsError(new NotImplementedException("not implemented.")); + public Response getIndexWithResponse(String indexName, + SearchRequestOptions searchRequestOptions, + Context context) { + return asyncClient.getIndexWithResponse(indexName, searchRequestOptions, context).block(); + } + + /** + * Determines whether or not the given index exists in the Azure Cognitive Search. + * @param indexName The name of the index + * @return true if the index exists; false otherwise. + */ + public Boolean indexExists(String indexName) { + return indexExistsWithResponse(indexName, null, Context.NONE).getValue(); + } + + /** + * Determines whether or not the given index exists in the Azure Cognitive Search. + * @param indexName The name of the index + * @param searchRequestOptions Additional parameters for the operation. + * @return true if the index exists; false otherwise. + */ + public Boolean indexExists(String indexName, + SearchRequestOptions searchRequestOptions) { + return indexExistsWithResponse(indexName, searchRequestOptions, Context.NONE).getValue(); + } + + /** + * Determines whether or not the given index exists in the Azure Cognitive Search. + * @param indexName The name of the index + * @param searchRequestOptions Additional parameters for the operation + * @param context additional context that is passed through the Http pipeline during the service call + * @return true if the index exists; false otherwise. + */ + public Response indexExistsWithResponse(String indexName, + SearchRequestOptions searchRequestOptions, + Context context) { + return asyncClient.indexExistsWithResponse(indexName, searchRequestOptions, context).block(); } /** diff --git a/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementAsyncTests.java b/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementAsyncTests.java index 583782428b907..3775594abee3a 100644 --- a/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementAsyncTests.java +++ b/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementAsyncTests.java @@ -3,9 +3,9 @@ package com.azure.search; import com.azure.core.exception.HttpResponseException; +import com.azure.search.models.Index; import com.azure.search.models.DataType; import com.azure.search.models.Field; -import com.azure.search.models.Index; import com.azure.search.models.ScoringProfile; import com.azure.search.models.MagnitudeScoringParameters; import com.azure.search.models.MagnitudeScoringFunction; @@ -15,6 +15,7 @@ import io.netty.handler.codec.http.HttpResponseStatus; import org.junit.Assert; import reactor.test.StepVerifier; + import java.util.Collections; public class IndexManagementAsyncTests extends IndexManagementTestBase { @@ -82,22 +83,53 @@ public void createIndexFailsWithUsefulMessageOnUserError() { @Override public void getIndexReturnsCorrectDefinition() { + client = getSearchServiceClientBuilder().buildAsyncClient(); + + Index index = createTestIndex(); + client.createIndex(index).block(); + StepVerifier + .create(client.getIndex(index.getName())) + .assertNext(res -> { + assertIndexesEqual(index, res); + }) + .verifyComplete(); } @Override public void getIndexThrowsOnNotFound() { + client = getSearchServiceClientBuilder().buildAsyncClient(); + StepVerifier + .create(client.getIndex("thisindexdoesnotexist")) + .verifyErrorSatisfies(error -> { + Assert.assertEquals(HttpResponseException.class, error.getClass()); + Assert.assertEquals(HttpResponseStatus.NOT_FOUND.code(), ((HttpResponseException) error).getResponse().getStatusCode()); + Assert.assertTrue(error.getMessage().contains("No index with the name 'thisindexdoesnotexist' was found in the service")); + }); } @Override public void existsReturnsTrueForExistingIndex() { + client = getSearchServiceClientBuilder().buildAsyncClient(); + + Index index = createTestIndex(); + client.createIndex(index).block(); + StepVerifier + .create(client.indexExists(index.getName())) + .assertNext(res -> Assert.assertTrue(res)) + .verifyComplete(); } @Override public void existsReturnsFalseForNonExistingIndex() { + client = getSearchServiceClientBuilder().buildAsyncClient(); + StepVerifier + .create(client.indexExists("invalidindex")) + .assertNext(res -> Assert.assertFalse(res)) + .verifyComplete(); } @Override diff --git a/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementSyncTests.java b/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementSyncTests.java index 6a5392d54c606..6de9403507224 100644 --- a/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementSyncTests.java +++ b/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementSyncTests.java @@ -13,6 +13,7 @@ import com.azure.search.models.ScoringFunctionAggregation; import com.azure.search.models.ScoringFunctionInterpolation; import com.azure.search.models.CorsOptions; +import io.netty.handler.codec.http.HttpResponseStatus; import org.junit.Assert; import org.junit.Rule; import org.junit.rules.ExpectedException; @@ -78,22 +79,44 @@ public void createIndexFailsWithUsefulMessageOnUserError() { @Override public void getIndexReturnsCorrectDefinition() { + client = getSearchServiceClientBuilder().buildClient(); + Index index = createTestIndex(); + client.createIndex(index); + Index createdIndex = client.getIndex(index.getName()); + + assertIndexesEqual(createdIndex, index); } @Override public void getIndexThrowsOnNotFound() { + client = getSearchServiceClientBuilder().buildClient(); + try { + client.getIndex("thisindexdoesnotexist"); + Assert.fail("getIndex did not throw an expected Exception"); + } catch (Exception ex) { + Assert.assertEquals(HttpResponseException.class, ex.getClass()); + Assert.assertEquals(HttpResponseStatus.NOT_FOUND.code(), ((HttpResponseException) ex).getResponse().getStatusCode()); + Assert.assertTrue(ex.getMessage().contains("No index with the name 'thisindexdoesnotexist' was found in the service")); + } } @Override public void existsReturnsTrueForExistingIndex() { + client = getSearchServiceClientBuilder().buildClient(); + Index index = createTestIndex(); + client.createIndex(index); + + Assert.assertTrue(client.indexExists(index.getName())); } @Override public void existsReturnsFalseForNonExistingIndex() { + client = getSearchServiceClientBuilder().buildClient(); + Assert.assertFalse(client.indexExists("invalidindex")); } @Override diff --git a/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementTestBase.java b/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementTestBase.java index a43c378bcfee3..d38fdec6e2a12 100644 --- a/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementTestBase.java +++ b/sdk/search/azure-search/src/test/java/com/azure/search/IndexManagementTestBase.java @@ -8,30 +8,35 @@ import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.search.models.AnalyzerName; +import com.azure.search.models.CorsOptions; import com.azure.search.models.DataType; +import com.azure.search.models.DistanceScoringFunction; +import com.azure.search.models.DistanceScoringParameters; import com.azure.search.models.Field; +import com.azure.search.models.FreshnessScoringFunction; +import com.azure.search.models.FreshnessScoringParameters; import com.azure.search.models.Index; -import com.azure.search.models.ScoringProfile; -import com.azure.search.models.MagnitudeScoringParameters; import com.azure.search.models.MagnitudeScoringFunction; +import com.azure.search.models.MagnitudeScoringParameters; +import com.azure.search.models.ScoringFunction; import com.azure.search.models.ScoringFunctionAggregation; import com.azure.search.models.ScoringFunctionInterpolation; -import com.azure.search.models.DistanceScoringParameters; -import com.azure.search.models.DistanceScoringFunction; -import com.azure.search.models.TagScoringParameters; +import com.azure.search.models.ScoringProfile; +import com.azure.search.models.Suggester; import com.azure.search.models.TagScoringFunction; +import com.azure.search.models.TagScoringParameters; import com.azure.search.models.TextWeights; -import com.azure.search.models.CorsOptions; -import com.azure.search.models.Suggester; -import com.azure.search.models.FreshnessScoringParameters; -import com.azure.search.models.FreshnessScoringFunction; +import com.azure.search.test.environment.models.ModelComparer; +import org.junit.Assert; import org.junit.Test; import java.time.Duration; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; -import java.util.Collections; +import java.util.Objects; public abstract class IndexManagementTestBase extends SearchServiceTestBase { @Override @@ -66,12 +71,16 @@ protected SearchServiceClientBuilder getSearchServiceClientBuilder() { @Test public abstract void createIndexFailsWithUsefulMessageOnUserError(); + @Test public abstract void getIndexReturnsCorrectDefinition(); + @Test public abstract void getIndexThrowsOnNotFound(); + @Test public abstract void existsReturnsTrueForExistingIndex(); + @Test public abstract void existsReturnsFalseForNonExistingIndex(); public abstract void deleteIndexIfNotChangedWorksOnlyOnCurrentResource(); @@ -83,8 +92,111 @@ protected SearchServiceClientBuilder getSearchServiceClientBuilder() { public abstract void canCreateAndDeleteIndex(); - protected Index createTestIndex() { + protected void assertFieldsEquals(Field expected, Field actual) { + Assert.assertEquals(expected.getName(), actual.getName()); + Assert.assertEquals(expected.isKey(), actual.isKey()); + Assert.assertEquals(expected.isSearchable(), actual.isSearchable()); + Assert.assertEquals(expected.isFilterable(), actual.isFilterable()); + Assert.assertEquals(expected.isSortable(), actual.isSortable()); + Assert.assertEquals(expected.isFacetable(), actual.isFacetable()); + } + + protected void assertIndexesEqual(Index expected, Index actual) { + Double delta = 0.0; + + // Name + Assert.assertEquals(expected.getName(), actual.getName()); + + // Fields + List expectedFields = expected.getFields(); + List actualFields = expected.getFields(); + Assert.assertEquals(expectedFields.size(), actualFields.size()); + for (int i = 0; i < expectedFields.size(); i++) { + Field expectedField = expectedFields.get(i); + Field actualField = actualFields.get(i); + + assertFieldsEquals(expectedField, actualField); + + // (Secondary) fields + if (expectedField.getFields() != null && actualField.getFields() != null) { + for (int j = 0; j < expectedField.getFields().size(); j++) { + assertFieldsEquals(expectedField.getFields().get(j), actualField.getFields().get(j)); + } + } + } + + // Scoring profiles + Assert.assertEquals(expected.getScoringProfiles().size(), actual.getScoringProfiles().size()); + for (int i = 0; i < expected.getScoringProfiles().size(); i++) { + ScoringProfile expectedScoringProfile = expected.getScoringProfiles().get(i); + ScoringProfile actualScoringProfile = actual.getScoringProfiles().get(i); + + Assert.assertEquals(expectedScoringProfile.getName(), actualScoringProfile.getName()); + Assert.assertTrue(Objects.equals(expectedScoringProfile.getFunctionAggregation(), actualScoringProfile.getFunctionAggregation())); + + // Scoring functions + Assert.assertEquals(expectedScoringProfile.getFunctions().size(), actualScoringProfile.getFunctions().size()); + for (int j = 0; j < expectedScoringProfile.getFunctions().size(); j++) { + ScoringFunction expectedFunction = expectedScoringProfile.getFunctions().get(j); + ScoringFunction actualFunction = expectedScoringProfile.getFunctions().get(j); + Assert.assertEquals(expectedFunction.getFieldName(), actualFunction.getFieldName()); + Assert.assertEquals(expectedFunction.getBoost(), actualFunction.getBoost(), delta); + Assert.assertEquals(expectedFunction.getInterpolation(), actualFunction.getInterpolation()); + + if (expectedFunction instanceof MagnitudeScoringFunction) { + MagnitudeScoringFunction expectedMsf = (MagnitudeScoringFunction) expectedFunction; + MagnitudeScoringFunction actualMsf = (MagnitudeScoringFunction) actualFunction; + MagnitudeScoringParameters expectedParams = expectedMsf.getParameters(); + MagnitudeScoringParameters actualParams = actualMsf.getParameters(); + Assert.assertEquals(expectedParams.getBoostingRangeStart(), actualParams.getBoostingRangeStart(), delta); + Assert.assertEquals(expectedParams.getBoostingRangeEnd(), actualParams.getBoostingRangeEnd(), delta); + } + if (expectedFunction instanceof DistanceScoringFunction) { + DistanceScoringFunction expectedDsf = (DistanceScoringFunction) expectedFunction; + DistanceScoringFunction actualDsf = (DistanceScoringFunction) actualFunction; + DistanceScoringParameters expectedParams = expectedDsf.getParameters(); + DistanceScoringParameters actualParams = actualDsf.getParameters(); + Assert.assertEquals(expectedParams.getBoostingDistance(), actualParams.getBoostingDistance(), delta); + Assert.assertEquals(expectedParams.getReferencePointParameter(), actualParams.getReferencePointParameter()); + } + + if (expectedFunction instanceof FreshnessScoringFunction) { + Assert.assertEquals(((FreshnessScoringFunction) expectedFunction).getParameters().getBoostingDuration(), + ((FreshnessScoringFunction) actualFunction).getParameters().getBoostingDuration()); + } + + if (expectedFunction instanceof TagScoringFunction) { + Assert.assertEquals(((TagScoringFunction) expectedFunction).getParameters().getTagsParameter(), + ((TagScoringFunction) actualFunction).getParameters().getTagsParameter()); + } + + } + if (expectedScoringProfile.getTextWeights() != null && actualScoringProfile.getTextWeights().getWeights() != null) { + Assert.assertEquals(expectedScoringProfile.getTextWeights().getWeights().size(), actualScoringProfile.getTextWeights().getWeights().size()); + } + } + + // Default scoring profile + Assert.assertEquals(expected.getDefaultScoringProfile(), actual.getDefaultScoringProfile()); + + // Cors options + ModelComparer.collectionEquals(expected.getCorsOptions().getAllowedOrigins(), actual.getCorsOptions().getAllowedOrigins()); + Assert.assertEquals(expected.getCorsOptions().getMaxAgeInSeconds(), actual.getCorsOptions().getMaxAgeInSeconds()); + + // Suggesters + List expectedSuggesters = expected.getSuggesters(); + List actualSuggesters = expected.getSuggesters(); + Assert.assertEquals(expectedSuggesters.size(), actualSuggesters.size()); + for (int i = 0; i < expectedSuggesters.size(); i++) { + Suggester expectedSuggester = expectedSuggesters.get(i); + Suggester actualSuggester = actualSuggesters.get(i); + Assert.assertEquals(expectedSuggester.getName(), actualSuggester.getName()); + ModelComparer.collectionEquals(expectedSuggester.getSourceFields(), actualSuggester.getSourceFields()); + } + } + + protected Index createTestIndex() { Map weights = new HashMap(); weights.put("Description", 1.5); weights.put("Category", 2.0); diff --git a/sdk/search/azure-search/src/test/java/com/azure/search/SearchIndexAsyncClientImplTest.java b/sdk/search/azure-search/src/test/java/com/azure/search/SearchIndexAsyncClientImplTest.java index dac6de0930c9c..c6a0d254ebac4 100644 --- a/sdk/search/azure-search/src/test/java/com/azure/search/SearchIndexAsyncClientImplTest.java +++ b/sdk/search/azure-search/src/test/java/com/azure/search/SearchIndexAsyncClientImplTest.java @@ -176,8 +176,7 @@ public void canGetPaginatedDocuments() throws Exception { Runnable runnable1 = () -> { try { processResult(asyncClient.search(), 200); - } - catch (Exception ex) { + } catch (Exception ex) { System.out.println("An exception occurred: " + ex.getMessage()); failed.set(true); } @@ -186,8 +185,7 @@ public void canGetPaginatedDocuments() throws Exception { Runnable runnable2 = () -> { try { processResult(asyncClient.search(), 200); - } - catch (Exception ex) { + } catch (Exception ex) { System.out.println("An exception occurred: " + ex.getMessage()); failed.set(true); } @@ -197,8 +195,7 @@ public void canGetPaginatedDocuments() throws Exception { Runnable runnable3 = () -> { try { processResult(asyncClient.search(), 200); - } - catch (Exception ex) { + } catch (Exception ex) { System.out.println("An exception occurred: " + ex.getMessage()); failed.set(true); } @@ -241,8 +238,7 @@ public void canGetPaginatedDocumentsWithSearchParameters() throws Exception { try { SearchParameters sp = new SearchParameters(); processResult(asyncClient.search("*", sp, new SearchRequestOptions()), 200); - } - catch (Exception ex) { + } catch (Exception ex) { System.out.println("An exception occurred in searchWithNoSkip: " + ex.getMessage()); failed.set(true); } @@ -252,8 +248,7 @@ public void canGetPaginatedDocumentsWithSearchParameters() throws Exception { try { SearchParameters sp = new SearchParameters().setSkip(10); processResult(asyncClient.search("*", sp, new SearchRequestOptions()), 190); - } - catch (Exception ex) { + } catch (Exception ex) { System.out.println("An exception occurred in searchWithSkip10: " + ex.getMessage()); failed.set(true); } @@ -264,8 +259,7 @@ public void canGetPaginatedDocumentsWithSearchParameters() throws Exception { try { SearchParameters sp = new SearchParameters().setSkip(30); processResult(asyncClient.search("*", sp, new SearchRequestOptions()), 170); - } - catch (Exception ex) { + } catch (Exception ex) { System.out.println("An exception occurred in searchWithSkip30: " + ex.getMessage()); failed.set(true); } diff --git a/sdk/search/azure-search/src/test/resources/session-records/createIndexFailsWithUsefulMessageOnUserError.json b/sdk/search/azure-search/src/test/resources/session-records/createIndexFailsWithUsefulMessageOnUserError.json index f8798062b42cc..b3335667da8b5 100644 --- a/sdk/search/azure-search/src/test/resources/session-records/createIndexFailsWithUsefulMessageOnUserError.json +++ b/sdk/search/azure-search/src/test/resources/session-records/createIndexFailsWithUsefulMessageOnUserError.json @@ -1,19 +1,19 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://azs-sdka94821976bc5.search.windows.net/indexes?api-version=2019-05-06", + "Uri" : "https://azs-sdkc86932563b15.search.windows.net/indexes?api-version=2019-05-06", "Headers" : { "Content-Type" : "application/json; charset=utf-8" }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "30d19c48-46df-45a0-903d-61978908747d", + "request-id" : "df4c3b22-f652-402b-a474-a6e355495982", "StatusCode" : "400", - "Date" : "Wed, 16 Oct 2019 18:10:06 GMT", + "Date" : "Thu, 17 Oct 2019 22:16:21 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "134", + "elapsed-time" : "49", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "160", diff --git a/sdk/search/azure-search/src/test/resources/session-records/createIndexReturnsCorrectDefaultValues.json b/sdk/search/azure-search/src/test/resources/session-records/createIndexReturnsCorrectDefaultValues.json index d0ab20b35edf3..50b22ecb874b0 100644 --- a/sdk/search/azure-search/src/test/resources/session-records/createIndexReturnsCorrectDefaultValues.json +++ b/sdk/search/azure-search/src/test/resources/session-records/createIndexReturnsCorrectDefaultValues.json @@ -1,27 +1,27 @@ { "networkCallRecords" : [ { "Method" : "POST", - "Uri" : "https://azs-sdk15252476860e.search.windows.net/indexes?api-version=2019-05-06", + "Uri" : "https://azs-sdk76623571d7f3.search.windows.net/indexes?api-version=2019-05-06", "Headers" : { "Content-Type" : "application/json; charset=utf-8" }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "09fc0e05-f612-44ca-8fcc-24b46dfd47ad", + "request-id" : "4270a4ca-a4a8-4415-999a-3389ee882d6e", "StatusCode" : "201", - "Date" : "Wed, 16 Oct 2019 18:10:16 GMT", + "Date" : "Thu, 17 Oct 2019 22:16:27 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "ETag" : "W/\"0x8D7526418F4311F\"", - "elapsed-time" : "3532", + "ETag" : "W/\"0x8D7534FA7D3B4BF\"", + "elapsed-time" : "800", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "6858", - "Body" : "{\"@odata.context\":\"https://azs-sdk15252476860e.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D7526418F4311F\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":\"MyProfile\",\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"HotelName\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Description_Custom\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":\"stop\",\"searchAnalyzer\":\"stop\",\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Category\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ParkingIncluded\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"LastRenovationDate\",\"type\":\"Edm.DateTimeOffset\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rating\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Address\",\"type\":\"Edm.ComplexType\",\"fields\":[{\"name\":\"StreetAddress\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"City\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"StateProvince\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Country\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"PostalCode\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"Location\",\"type\":\"Edm.GeographyPoint\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rooms\",\"type\":\"Collection(Edm.ComplexType)\",\"fields\":[{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Type\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BaseRate\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BedOptions\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SleepsCount\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"TotalGuests\",\"type\":\"Edm.Int64\",\"searchable\":false,\"filterable\":true,\"retrievable\":false,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ProfitMargin\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[{\"name\":\"MyProfile\",\"functionAggregation\":\"sum\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"linear\",\"type\":\"magnitude\",\"boost\":2.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":4.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]}],\"corsOptions\":{\"allowedOrigins\":[\"*\"],\"maxAgeInSeconds\":null},\"suggesters\":[{\"name\":\"FancySuggester\",\"searchMode\":\"analyzingInfixMatching\",\"sourceFields\":[\"HotelName\"]}],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk76623571d7f3.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D7534FA7D3B4BF\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":\"MyProfile\",\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"HotelName\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Description_Custom\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":\"stop\",\"searchAnalyzer\":\"stop\",\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Category\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ParkingIncluded\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"LastRenovationDate\",\"type\":\"Edm.DateTimeOffset\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rating\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Address\",\"type\":\"Edm.ComplexType\",\"fields\":[{\"name\":\"StreetAddress\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"City\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"StateProvince\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Country\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"PostalCode\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"Location\",\"type\":\"Edm.GeographyPoint\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rooms\",\"type\":\"Collection(Edm.ComplexType)\",\"fields\":[{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Type\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BaseRate\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BedOptions\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SleepsCount\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"TotalGuests\",\"type\":\"Edm.Int64\",\"searchable\":false,\"filterable\":true,\"retrievable\":false,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ProfitMargin\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[{\"name\":\"MyProfile\",\"functionAggregation\":\"sum\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"linear\",\"type\":\"magnitude\",\"boost\":2.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":4.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]}],\"corsOptions\":{\"allowedOrigins\":[\"*\"],\"maxAgeInSeconds\":null},\"suggesters\":[{\"name\":\"FancySuggester\",\"searchMode\":\"analyzingInfixMatching\",\"sourceFields\":[\"HotelName\"]}],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal", - "Location" : "https://azs-sdk15252476860e.search.windows.net/indexes('hotels')?api-version=2019-05-06" + "Location" : "https://azs-sdk76623571d7f3.search.windows.net/indexes('hotels')?api-version=2019-05-06" }, "Exception" : null } ], diff --git a/sdk/search/azure-search/src/test/resources/session-records/deleteIndexIsIdempotent.json b/sdk/search/azure-search/src/test/resources/session-records/deleteIndexIsIdempotent.json index aff23c568b7b1..61f40b9eae503 100644 --- a/sdk/search/azure-search/src/test/resources/session-records/deleteIndexIsIdempotent.json +++ b/sdk/search/azure-search/src/test/resources/session-records/deleteIndexIsIdempotent.json @@ -1,21 +1,21 @@ { "networkCallRecords" : [ { "Method" : "DELETE", - "Uri" : "https://azs-sdk2e3274612ed1.search.windows.net/indexes('hotels')?api-version=2019-05-06", + "Uri" : "https://azs-sdk1fe623768a3f.search.windows.net/indexes('hotels')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "cc006fb5-4a53-4050-8eed-fad57e893011", + "request-id" : "04b1f349-2a72-4288-b6e4-1878d5f9239e", "StatusCode" : "404", - "Date" : "Wed, 16 Oct 2019 23:54:47 GMT", + "Date" : "Thu, 17 Oct 2019 22:16:38 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "124", + "elapsed-time" : "39", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "117", - "Body" : "{\"error\":{\"code\":\"\",\"message\":\"No index with the name 'hotels' was found in a service named 'azs-sdk2e3274612ed1'.\"}}", + "Body" : "{\"error\":{\"code\":\"\",\"message\":\"No index with the name 'hotels' was found in a service named 'azs-sdk1fe623768a3f'.\"}}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Language" : "en", "Content-Type" : "application/json; odata.metadata=minimal" @@ -23,62 +23,62 @@ "Exception" : null }, { "Method" : "POST", - "Uri" : "https://azs-sdk2e3274612ed1.search.windows.net/indexes?api-version=2019-05-06", + "Uri" : "https://azs-sdk1fe623768a3f.search.windows.net/indexes?api-version=2019-05-06", "Headers" : { "Content-Type" : "application/json; charset=utf-8" }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "e4b4c810-ab44-4d43-9d8f-91fa3c8b4663", + "request-id" : "13107800-fe9d-4883-bd1a-1f608dc15302", "StatusCode" : "201", - "Date" : "Wed, 16 Oct 2019 23:54:48 GMT", + "Date" : "Thu, 17 Oct 2019 22:16:39 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "ETag" : "W/\"0x8D752943AA8D297\"", - "elapsed-time" : "1039", + "ETag" : "W/\"0x8D7534FAEEDAD78\"", + "elapsed-time" : "505", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "523", - "Body" : "{\"@odata.context\":\"https://azs-sdk2e3274612ed1.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D752943AA8D297\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":null,\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[],\"corsOptions\":null,\"suggesters\":[],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", + "Body" : "{\"@odata.context\":\"https://azs-sdk1fe623768a3f.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D7534FAEEDAD78\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":null,\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[],\"corsOptions\":null,\"suggesters\":[],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Type" : "application/json; odata.metadata=minimal", - "Location" : "https://azs-sdk2e3274612ed1.search.windows.net/indexes('hotels')?api-version=2019-05-06" + "Location" : "https://azs-sdk1fe623768a3f.search.windows.net/indexes('hotels')?api-version=2019-05-06" }, "Exception" : null }, { "Method" : "DELETE", - "Uri" : "https://azs-sdk2e3274612ed1.search.windows.net/indexes('hotels')?api-version=2019-05-06", + "Uri" : "https://azs-sdk1fe623768a3f.search.windows.net/indexes('hotels')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "521", + "elapsed-time" : "309", "Expires" : "-1", "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "582a1c36-9ec2-4e6e-800a-401479ed2e74", + "request-id" : "12dd72c4-4177-4bc2-be10-a438ce139415", "StatusCode" : "204", - "Date" : "Wed, 16 Oct 2019 23:54:48 GMT" + "Date" : "Thu, 17 Oct 2019 22:16:39 GMT" }, "Exception" : null }, { "Method" : "DELETE", - "Uri" : "https://azs-sdk2e3274612ed1.search.windows.net/indexes('hotels')?api-version=2019-05-06", + "Uri" : "https://azs-sdk1fe623768a3f.search.windows.net/indexes('hotels')?api-version=2019-05-06", "Headers" : { }, "Response" : { "Pragma" : "no-cache", "retry-after" : "0", - "request-id" : "8d7f89fa-5934-4508-b63d-17432aa391ee", + "request-id" : "bd0ec473-9b03-4b62-ad0a-1c9011884682", "StatusCode" : "404", - "Date" : "Wed, 16 Oct 2019 23:54:48 GMT", + "Date" : "Thu, 17 Oct 2019 22:16:39 GMT", "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", "Cache-Control" : "no-cache", - "elapsed-time" : "17", + "elapsed-time" : "15", "OData-Version" : "4.0", "Expires" : "-1", "Content-Length" : "117", - "Body" : "{\"error\":{\"code\":\"\",\"message\":\"No index with the name 'hotels' was found in a service named 'azs-sdk2e3274612ed1'.\"}}", + "Body" : "{\"error\":{\"code\":\"\",\"message\":\"No index with the name 'hotels' was found in a service named 'azs-sdk1fe623768a3f'.\"}}", "Preference-Applied" : "odata.include-annotations=\"*\"", "Content-Language" : "en", "Content-Type" : "application/json; odata.metadata=minimal" diff --git a/sdk/search/azure-search/src/test/resources/session-records/existsReturnsFalseForNonExistingIndex.json b/sdk/search/azure-search/src/test/resources/session-records/existsReturnsFalseForNonExistingIndex.json new file mode 100644 index 0000000000000..f08681bfe40ba --- /dev/null +++ b/sdk/search/azure-search/src/test/resources/session-records/existsReturnsFalseForNonExistingIndex.json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azs-sdk611501887ba4.search.windows.net/indexes('invalidindex')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "bfeb7d8f-7c9b-4377-8683-322b59e5c66c", + "StatusCode" : "404", + "Date" : "Thu, 17 Oct 2019 22:27:57 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "36", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "119", + "Body" : "{\"error\":{\"code\":\"\",\"message\":\"No index with the name 'invalidindex' was found in the service 'azs-sdk611501887ba4'.\"}}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Language" : "en", + "Content-Type" : "application/json; odata.metadata=minimal" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/search/azure-search/src/test/resources/session-records/existsReturnsTrueForExistingIndex.json b/sdk/search/azure-search/src/test/resources/session-records/existsReturnsTrueForExistingIndex.json new file mode 100644 index 0000000000000..8498392fda42c --- /dev/null +++ b/sdk/search/azure-search/src/test/resources/session-records/existsReturnsTrueForExistingIndex.json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://azs-sdk9b7476536b2f.search.windows.net/indexes?api-version=2019-05-06", + "Headers" : { + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "26d16668-5728-4f5d-880c-2d4f577769b0", + "StatusCode" : "201", + "Date" : "Thu, 17 Oct 2019 22:27:47 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "ETag" : "W/\"0x8D753513D47AF07\"", + "elapsed-time" : "477", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "8162", + "Body" : "{\"@odata.context\":\"https://azs-sdk9b7476536b2f.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D753513D47AF07\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":\"MyProfile\",\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"HotelName\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Description_Custom\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":\"stop\",\"searchAnalyzer\":\"stop\",\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Category\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ParkingIncluded\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"LastRenovationDate\",\"type\":\"Edm.DateTimeOffset\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rating\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Address\",\"type\":\"Edm.ComplexType\",\"fields\":[{\"name\":\"StreetAddress\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"City\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"StateProvince\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Country\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"PostalCode\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"Location\",\"type\":\"Edm.GeographyPoint\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rooms\",\"type\":\"Collection(Edm.ComplexType)\",\"fields\":[{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Type\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BaseRate\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BedOptions\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SleepsCount\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"TotalGuests\",\"type\":\"Edm.Int64\",\"searchable\":false,\"filterable\":true,\"retrievable\":false,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ProfitMargin\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[{\"name\":\"MyProfile\",\"functionAggregation\":\"average\",\"text\":{\"weights\":{\"Description\":1.5,\"Category\":2.0}},\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":2.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":4.0,\"constantBoostBeyondRange\":true},\"distance\":null,\"tag\":null},{\"fieldName\":\"Location\",\"interpolation\":\"linear\",\"type\":\"distance\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":{\"referencePointParameter\":\"Loc\",\"boostingDistance\":5.0},\"tag\":null},{\"fieldName\":\"LastRenovationDate\",\"interpolation\":\"logarithmic\",\"type\":\"freshness\",\"boost\":1.1,\"freshness\":{\"boostingDuration\":\"P365D\"},\"magnitude\":null,\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileTwo\",\"functionAggregation\":\"maximum\",\"text\":null,\"functions\":[{\"fieldName\":\"Tags\",\"interpolation\":\"linear\",\"type\":\"tag\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":null,\"tag\":{\"tagsParameter\":\"MyTags\"}}]},{\"name\":\"ProfileThree\",\"functionAggregation\":\"minimum\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"quadratic\",\"type\":\"magnitude\",\"boost\":3.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":0.0,\"boostingRangeEnd\":10.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileFour\",\"functionAggregation\":\"firstMatching\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":3.14,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":5.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]}],\"corsOptions\":{\"allowedOrigins\":[\"http://tempuri.org\",\"http://localhost:80\"],\"maxAgeInSeconds\":60},\"suggesters\":[{\"name\":\"FancySuggester\",\"searchMode\":\"analyzingInfixMatching\",\"sourceFields\":[\"HotelName\"]}],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal", + "Location" : "https://azs-sdk9b7476536b2f.search.windows.net/indexes('hotels')?api-version=2019-05-06" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://azs-sdk9b7476536b2f.search.windows.net/indexes('hotels')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "be52349f-b952-412c-a031-8392c1fc9a36", + "StatusCode" : "200", + "Date" : "Thu, 17 Oct 2019 22:27:47 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "ETag" : "W/\"0x8D753513D47AF07\"", + "elapsed-time" : "61", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "8162", + "Body" : "{\"@odata.context\":\"https://azs-sdk9b7476536b2f.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D753513D47AF07\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":\"MyProfile\",\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"HotelName\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Description_Custom\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":\"stop\",\"searchAnalyzer\":\"stop\",\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Category\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ParkingIncluded\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"LastRenovationDate\",\"type\":\"Edm.DateTimeOffset\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rating\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Address\",\"type\":\"Edm.ComplexType\",\"fields\":[{\"name\":\"StreetAddress\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"City\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"StateProvince\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Country\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"PostalCode\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"Location\",\"type\":\"Edm.GeographyPoint\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rooms\",\"type\":\"Collection(Edm.ComplexType)\",\"fields\":[{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Type\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BaseRate\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BedOptions\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SleepsCount\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"TotalGuests\",\"type\":\"Edm.Int64\",\"searchable\":false,\"filterable\":true,\"retrievable\":false,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ProfitMargin\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[{\"name\":\"MyProfile\",\"functionAggregation\":\"average\",\"text\":{\"weights\":{\"Description\":1.5,\"Category\":2.0}},\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":2.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":4.0,\"constantBoostBeyondRange\":true},\"distance\":null,\"tag\":null},{\"fieldName\":\"Location\",\"interpolation\":\"linear\",\"type\":\"distance\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":{\"referencePointParameter\":\"Loc\",\"boostingDistance\":5.0},\"tag\":null},{\"fieldName\":\"LastRenovationDate\",\"interpolation\":\"logarithmic\",\"type\":\"freshness\",\"boost\":1.1,\"freshness\":{\"boostingDuration\":\"P365D\"},\"magnitude\":null,\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileTwo\",\"functionAggregation\":\"maximum\",\"text\":null,\"functions\":[{\"fieldName\":\"Tags\",\"interpolation\":\"linear\",\"type\":\"tag\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":null,\"tag\":{\"tagsParameter\":\"MyTags\"}}]},{\"name\":\"ProfileThree\",\"functionAggregation\":\"minimum\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"quadratic\",\"type\":\"magnitude\",\"boost\":3.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":0.0,\"boostingRangeEnd\":10.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileFour\",\"functionAggregation\":\"firstMatching\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":3.14,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":5.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]}],\"corsOptions\":{\"allowedOrigins\":[\"http://tempuri.org\",\"http://localhost:80\"],\"maxAgeInSeconds\":60},\"suggesters\":[{\"name\":\"FancySuggester\",\"searchMode\":\"analyzingInfixMatching\",\"sourceFields\":[\"HotelName\"]}],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/search/azure-search/src/test/resources/session-records/getIndexReturnsCorrectDefinition.json b/sdk/search/azure-search/src/test/resources/session-records/getIndexReturnsCorrectDefinition.json new file mode 100644 index 0000000000000..4b0030bed42fd --- /dev/null +++ b/sdk/search/azure-search/src/test/resources/session-records/getIndexReturnsCorrectDefinition.json @@ -0,0 +1,51 @@ +{ + "networkCallRecords" : [ { + "Method" : "POST", + "Uri" : "https://azs-sdk4b4741207585.search.windows.net/indexes?api-version=2019-05-06", + "Headers" : { + "Content-Type" : "application/json; charset=utf-8" + }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "2fdada05-24a4-448b-8ec8-c65b04ffa144", + "StatusCode" : "201", + "Date" : "Thu, 17 Oct 2019 22:27:29 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "ETag" : "W/\"0x8D7535131E8BE19\"", + "elapsed-time" : "891", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "8162", + "Body" : "{\"@odata.context\":\"https://azs-sdk4b4741207585.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D7535131E8BE19\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":\"MyProfile\",\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"HotelName\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Description_Custom\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":\"stop\",\"searchAnalyzer\":\"stop\",\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Category\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ParkingIncluded\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"LastRenovationDate\",\"type\":\"Edm.DateTimeOffset\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rating\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Address\",\"type\":\"Edm.ComplexType\",\"fields\":[{\"name\":\"StreetAddress\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"City\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"StateProvince\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Country\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"PostalCode\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"Location\",\"type\":\"Edm.GeographyPoint\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rooms\",\"type\":\"Collection(Edm.ComplexType)\",\"fields\":[{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Type\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BaseRate\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BedOptions\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SleepsCount\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"TotalGuests\",\"type\":\"Edm.Int64\",\"searchable\":false,\"filterable\":true,\"retrievable\":false,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ProfitMargin\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[{\"name\":\"MyProfile\",\"functionAggregation\":\"average\",\"text\":{\"weights\":{\"Description\":1.5,\"Category\":2.0}},\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":2.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":4.0,\"constantBoostBeyondRange\":true},\"distance\":null,\"tag\":null},{\"fieldName\":\"Location\",\"interpolation\":\"linear\",\"type\":\"distance\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":{\"referencePointParameter\":\"Loc\",\"boostingDistance\":5.0},\"tag\":null},{\"fieldName\":\"LastRenovationDate\",\"interpolation\":\"logarithmic\",\"type\":\"freshness\",\"boost\":1.1,\"freshness\":{\"boostingDuration\":\"P365D\"},\"magnitude\":null,\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileTwo\",\"functionAggregation\":\"maximum\",\"text\":null,\"functions\":[{\"fieldName\":\"Tags\",\"interpolation\":\"linear\",\"type\":\"tag\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":null,\"tag\":{\"tagsParameter\":\"MyTags\"}}]},{\"name\":\"ProfileThree\",\"functionAggregation\":\"minimum\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"quadratic\",\"type\":\"magnitude\",\"boost\":3.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":0.0,\"boostingRangeEnd\":10.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileFour\",\"functionAggregation\":\"firstMatching\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":3.14,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":5.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]}],\"corsOptions\":{\"allowedOrigins\":[\"http://tempuri.org\",\"http://localhost:80\"],\"maxAgeInSeconds\":60},\"suggesters\":[{\"name\":\"FancySuggester\",\"searchMode\":\"analyzingInfixMatching\",\"sourceFields\":[\"HotelName\"]}],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal", + "Location" : "https://azs-sdk4b4741207585.search.windows.net/indexes('hotels')?api-version=2019-05-06" + }, + "Exception" : null + }, { + "Method" : "GET", + "Uri" : "https://azs-sdk4b4741207585.search.windows.net/indexes('hotels')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "9dc4be61-0a35-4fa8-910e-66935d93d1d6", + "StatusCode" : "200", + "Date" : "Thu, 17 Oct 2019 22:27:29 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "ETag" : "W/\"0x8D7535131E8BE19\"", + "elapsed-time" : "33", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "8162", + "Body" : "{\"@odata.context\":\"https://azs-sdk4b4741207585.search.windows.net/$metadata#indexes/$entity\",\"@odata.etag\":\"\\\"0x8D7535131E8BE19\\\"\",\"name\":\"hotels\",\"defaultScoringProfile\":\"MyProfile\",\"fields\":[{\"name\":\"HotelId\",\"type\":\"Edm.String\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":true,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"HotelName\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Description_Custom\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":false,\"retrievable\":true,\"sortable\":false,\"facetable\":false,\"key\":false,\"indexAnalyzer\":\"stop\",\"searchAnalyzer\":\"stop\",\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Category\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ParkingIncluded\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"LastRenovationDate\",\"type\":\"Edm.DateTimeOffset\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rating\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Address\",\"type\":\"Edm.ComplexType\",\"fields\":[{\"name\":\"StreetAddress\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"City\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"StateProvince\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Country\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"PostalCode\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"Location\",\"type\":\"Edm.GeographyPoint\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":false,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Rooms\",\"type\":\"Collection(Edm.ComplexType)\",\"fields\":[{\"name\":\"Description\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"en.lucene\",\"synonymMaps\":[]},{\"name\":\"DescriptionFr\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":\"fr.lucene\",\"synonymMaps\":[]},{\"name\":\"Type\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BaseRate\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"BedOptions\",\"type\":\"Edm.String\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SleepsCount\",\"type\":\"Edm.Int32\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"SmokingAllowed\",\"type\":\"Edm.Boolean\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"Tags\",\"type\":\"Collection(Edm.String)\",\"searchable\":true,\"filterable\":true,\"retrievable\":true,\"sortable\":false,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}]},{\"name\":\"TotalGuests\",\"type\":\"Edm.Int64\",\"searchable\":false,\"filterable\":true,\"retrievable\":false,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]},{\"name\":\"ProfitMargin\",\"type\":\"Edm.Double\",\"searchable\":false,\"filterable\":true,\"retrievable\":true,\"sortable\":true,\"facetable\":true,\"key\":false,\"indexAnalyzer\":null,\"searchAnalyzer\":null,\"analyzer\":null,\"synonymMaps\":[]}],\"scoringProfiles\":[{\"name\":\"MyProfile\",\"functionAggregation\":\"average\",\"text\":{\"weights\":{\"Description\":1.5,\"Category\":2.0}},\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":2.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":4.0,\"constantBoostBeyondRange\":true},\"distance\":null,\"tag\":null},{\"fieldName\":\"Location\",\"interpolation\":\"linear\",\"type\":\"distance\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":{\"referencePointParameter\":\"Loc\",\"boostingDistance\":5.0},\"tag\":null},{\"fieldName\":\"LastRenovationDate\",\"interpolation\":\"logarithmic\",\"type\":\"freshness\",\"boost\":1.1,\"freshness\":{\"boostingDuration\":\"P365D\"},\"magnitude\":null,\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileTwo\",\"functionAggregation\":\"maximum\",\"text\":null,\"functions\":[{\"fieldName\":\"Tags\",\"interpolation\":\"linear\",\"type\":\"tag\",\"boost\":1.5,\"freshness\":null,\"magnitude\":null,\"distance\":null,\"tag\":{\"tagsParameter\":\"MyTags\"}}]},{\"name\":\"ProfileThree\",\"functionAggregation\":\"minimum\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"quadratic\",\"type\":\"magnitude\",\"boost\":3.0,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":0.0,\"boostingRangeEnd\":10.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]},{\"name\":\"ProfileFour\",\"functionAggregation\":\"firstMatching\",\"text\":null,\"functions\":[{\"fieldName\":\"Rating\",\"interpolation\":\"constant\",\"type\":\"magnitude\",\"boost\":3.14,\"freshness\":null,\"magnitude\":{\"boostingRangeStart\":1.0,\"boostingRangeEnd\":5.0,\"constantBoostBeyondRange\":false},\"distance\":null,\"tag\":null}]}],\"corsOptions\":{\"allowedOrigins\":[\"http://tempuri.org\",\"http://localhost:80\"],\"maxAgeInSeconds\":60},\"suggesters\":[{\"name\":\"FancySuggester\",\"searchMode\":\"analyzingInfixMatching\",\"sourceFields\":[\"HotelName\"]}],\"analyzers\":[],\"tokenizers\":[],\"tokenFilters\":[],\"charFilters\":[]}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Type" : "application/json; odata.metadata=minimal" + }, + "Exception" : null + } ], + "variables" : [ ] +} diff --git a/sdk/search/azure-search/src/test/resources/session-records/getIndexThrowsOnNotFound.json b/sdk/search/azure-search/src/test/resources/session-records/getIndexThrowsOnNotFound.json new file mode 100644 index 0000000000000..df47de706b7ba --- /dev/null +++ b/sdk/search/azure-search/src/test/resources/session-records/getIndexThrowsOnNotFound.json @@ -0,0 +1,26 @@ +{ + "networkCallRecords" : [ { + "Method" : "GET", + "Uri" : "https://azs-sdkf0412552dfda.search.windows.net/indexes('thisindexdoesnotexist')?api-version=2019-05-06", + "Headers" : { }, + "Response" : { + "Pragma" : "no-cache", + "retry-after" : "0", + "request-id" : "563b9d25-eff3-4ac4-88e1-9b70a2a35eed", + "StatusCode" : "404", + "Date" : "Thu, 17 Oct 2019 22:27:34 GMT", + "Strict-Transport-Security" : "max-age=15724800; includeSubDomains", + "Cache-Control" : "no-cache", + "elapsed-time" : "72", + "OData-Version" : "4.0", + "Expires" : "-1", + "Content-Length" : "128", + "Body" : "{\"error\":{\"code\":\"\",\"message\":\"No index with the name 'thisindexdoesnotexist' was found in the service 'azs-sdkf0412552dfda'.\"}}", + "Preference-Applied" : "odata.include-annotations=\"*\"", + "Content-Language" : "en", + "Content-Type" : "application/json; odata.metadata=minimal" + }, + "Exception" : null + } ], + "variables" : [ ] +}