diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/DataSources.java b/sdk/search/azure-search/src/main/java/com/azure/search/DataSources.java index 915457e0fec1..23f941a01153 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/DataSources.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/DataSources.java @@ -178,7 +178,7 @@ public static DataSource azureTableStorage( /** * Creates a new DataSource to connect to a Cosmos database. * - * @param name The name of the datasource. + * @param name The name of the data source. * @param cosmosConnectionString The connection string for the Cosmos database. It must follow this format: * AccountName|AccountEndpoint=[your account name or endpoint]; * AccountKey=[your account key];Database=[your database name]" diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexAsyncClient.java b/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexAsyncClient.java index a4f16600b32a..3d982dbdea2c 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexAsyncClient.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexAsyncClient.java @@ -21,7 +21,7 @@ import com.azure.search.models.AutocompleteOptions; import com.azure.search.models.AutocompleteRequest; import com.azure.search.models.DocumentIndexResult; -import com.azure.search.implementation.models.IndexAction; +import com.azure.search.models.IndexAction; import com.azure.search.implementation.models.IndexActionType; import com.azure.search.models.IndexBatch; import com.azure.search.models.RequestOptions; @@ -476,7 +476,7 @@ Mono> indexWithResponse(IndexBatch batch, Conte } /** - * Autocompletes incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. + * Autocomplete incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. * * @param searchText search text * @param suggesterName suggester name @@ -488,7 +488,7 @@ public PagedFluxBase autocomplete( } /** - * Autocompletes incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. + * Autocomplete incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. * * @param searchText search text * @param suggesterName suggester name @@ -569,7 +569,7 @@ private Mono searchNextPage( // Extract the value of top and skip from @search.nextPageParameters in SearchPagedResponse ObjectMapper objectMapper = new ObjectMapper(); - SearchRequest nextPageRequest = null; + SearchRequest nextPageRequest; try { nextPageRequest = objectMapper.readValue(nextPageParameters, SearchRequest.class); } catch (JsonProcessingException e) { diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexClient.java b/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexClient.java index b27565d7edfc..5ed6283913d3 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexClient.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/SearchIndexClient.java @@ -321,7 +321,7 @@ public Response indexWithResponse(IndexBatch batch, Cont } /** - * Autocompletes incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. + * Autocomplete incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. * * @param searchText search text * @param suggesterName suggester name @@ -333,7 +333,7 @@ public PagedIterableBase autocomple } /** - * Autocompletes incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. + * Autocomplete incomplete query terms based on input text and matching terms in the Azure Cognitive Search index. * * @param searchText search text * @param suggesterName suggester name diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/SuggestOptionsHandler.java b/sdk/search/azure-search/src/main/java/com/azure/search/SuggestOptionsHandler.java index f54218a5483f..2278edcad4d9 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/SuggestOptionsHandler.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/SuggestOptionsHandler.java @@ -8,7 +8,7 @@ /** * TODO: Add class description */ -public class SuggestOptionsHandler { +class SuggestOptionsHandler { /** * Ensure all suggest parameters are correct @@ -17,7 +17,7 @@ public class SuggestOptionsHandler { * @param suggestOptions suggest parameters * @return SuggestOptions ensured suggest parameters */ - public static SuggestOptions ensureSuggestOptions(SuggestOptions suggestOptions) { + static SuggestOptions ensureSuggestOptions(SuggestOptions suggestOptions) { if (suggestOptions == null) { return null; } diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/implementation/models/IndexBatchImpl.java b/sdk/search/azure-search/src/main/java/com/azure/search/implementation/models/IndexBatchImpl.java index e1904b1dd7ad..84129016b9fc 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/implementation/models/IndexBatchImpl.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/implementation/models/IndexBatchImpl.java @@ -7,6 +7,7 @@ package com.azure.search.implementation.models; import com.azure.core.annotation.Fluent; +import com.azure.search.models.IndexAction; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/models/CoordinateSystem.java b/sdk/search/azure-search/src/main/java/com/azure/search/models/CoordinateSystem.java index 61069fd65d89..304b1f30af15 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/models/CoordinateSystem.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/models/CoordinateSystem.java @@ -16,7 +16,7 @@ */ @Fluent public class CoordinateSystem { - public static final String NAME_PROPERTY = "name"; + private static final String NAME_PROPERTY = "name"; @JsonProperty private String type; diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/implementation/models/IndexAction.java b/sdk/search/azure-search/src/main/java/com/azure/search/models/IndexAction.java similarity index 96% rename from sdk/search/azure-search/src/main/java/com/azure/search/implementation/models/IndexAction.java rename to sdk/search/azure-search/src/main/java/com/azure/search/models/IndexAction.java index a9a119145e21..44db2f10b325 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/implementation/models/IndexAction.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/models/IndexAction.java @@ -4,9 +4,10 @@ // Changes may cause incorrect behavior and will be lost if the code is // regenerated. -package com.azure.search.implementation.models; +package com.azure.search.models; import com.azure.core.annotation.Fluent; +import com.azure.search.implementation.models.IndexActionType; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/sdk/search/azure-search/src/main/java/com/azure/search/models/IndexBatch.java b/sdk/search/azure-search/src/main/java/com/azure/search/models/IndexBatch.java index b19d07021ac3..4a9cb4ef40d1 100644 --- a/sdk/search/azure-search/src/main/java/com/azure/search/models/IndexBatch.java +++ b/sdk/search/azure-search/src/main/java/com/azure/search/models/IndexBatch.java @@ -4,7 +4,6 @@ import com.azure.core.annotation.Fluent; import com.azure.search.Document; -import com.azure.search.implementation.models.IndexAction; import com.azure.search.implementation.models.IndexActionType; import com.azure.search.implementation.models.IndexBatchImpl; diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/HttpResponseExceptionExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/HttpResponseExceptionExample.java index e548b0fb478a..71e178f1d38f 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/HttpResponseExceptionExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/HttpResponseExceptionExample.java @@ -28,6 +28,8 @@ public class HttpResponseExceptionExample { private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); private static final String API_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_API_KEY"); + private static final String INDEX_NAME = "hotels-sample-index"; + public static void main(String[] args) { handleErrorsWithSyncClient(); handleErrorsWithAsyncClient(); @@ -40,7 +42,7 @@ private static void handleErrorsWithSyncClient() { SearchIndexClient client = new SearchIndexClientBuilder() .endpoint(ENDPOINT) .credential(new SearchApiKeyCredential(API_KEY)) - .indexName("hotels") + .indexName(INDEX_NAME) .buildClient(); try { @@ -71,7 +73,7 @@ private static void handleErrorsWithAsyncClient() { SearchIndexAsyncClient client = new SearchIndexClientBuilder() .endpoint(ENDPOINT) .credential(new SearchApiKeyCredential(API_KEY)) - .indexName("hotels") + .indexName(INDEX_NAME) .buildAsyncClient(); SearchOptions searchOptions = new SearchOptions() diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/IndexAndServiceStatisticsExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/IndexAndServiceStatisticsExample.java index 2577475cf5f0..98290c97193c 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/IndexAndServiceStatisticsExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/IndexAndServiceStatisticsExample.java @@ -42,7 +42,7 @@ public class IndexAndServiceStatisticsExample { * populate ADMIN_KEY and SEARCH_SERVICE_NAME. */ private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); - private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_API_KEY"); + private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); public static void main(String[] args) { SearchServiceClient client = createClient(); diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/IndexContentManagementExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/IndexContentManagementExample.java index 84d5581c091e..8571f7bc8bae 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/IndexContentManagementExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/IndexContentManagementExample.java @@ -24,7 +24,7 @@ public class IndexContentManagementExample { * and set the values of these environment variables: */ private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); - private static final String API_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_API_KEY"); + private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); private static final String INDEX_NAME = "hotels-sample-index"; @@ -40,7 +40,7 @@ public static void main(String[] args) { private static void basicIndexing() { SearchIndexClient client = new SearchIndexClientBuilder() .endpoint(ENDPOINT) - .credential(new SearchApiKeyCredential(API_KEY)) + .credential(new SearchApiKeyCredential(ADMIN_KEY)) .indexName(INDEX_NAME) .buildClient(); @@ -60,7 +60,7 @@ private static void basicIndexing() { private static void advancedIndexing() { SearchIndexClient client = new SearchIndexClientBuilder() .endpoint(ENDPOINT) - .credential(new SearchApiKeyCredential(API_KEY)) + .credential(new SearchApiKeyCredential(ADMIN_KEY)) .indexName(INDEX_NAME) .buildClient(); diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/LifecycleSetupExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/LifecycleSetupExample.java index 96dd544bb88e..f3a798c79a1e 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/LifecycleSetupExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/LifecycleSetupExample.java @@ -37,7 +37,7 @@ public class LifecycleSetupExample { * and set the values of these environment variables: */ private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); - private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_API_KEY"); + private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); // Using hard coded connection string to pre-populated Cosmos DB database with sample data set // For more information visit https://docs.microsoft.com/en-us/samples/azure-samples/azure-search-sample-data/azure-search-sample-data/ diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/ListIndexersExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/ListIndexersExample.java index 9a485680f002..133aa2cbff08 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/ListIndexersExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/ListIndexersExample.java @@ -22,7 +22,7 @@ public class ListIndexersExample { private static final String ENDPOINT = Configuration.getGlobalConfiguration() .get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); private static final String ADMIN_KEY = Configuration.getGlobalConfiguration() - .get("AZURE_COGNITIVE_SEARCH_API_KEY"); + .get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); public static void main(String[] args) { SearchServiceAsyncClient searchServiceClient = new SearchServiceClientBuilder() diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/RefineSearchCapabilitiesExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/RefineSearchCapabilitiesExample.java index 281086b25b8e..7b666926491f 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/RefineSearchCapabilitiesExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/RefineSearchCapabilitiesExample.java @@ -36,7 +36,7 @@ public class RefineSearchCapabilitiesExample { * and set the values of these environment variables: */ private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); - private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_API_KEY"); + private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); private static final String INDEX_NAME = "hotels-sample-index"; private static final String INDEXER_NAME = "hotels-sample-indexer"; diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/RunningSearchSolutionExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/RunningSearchSolutionExample.java index e4107a30f5c1..c5c93939f9ab 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/RunningSearchSolutionExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/RunningSearchSolutionExample.java @@ -34,7 +34,7 @@ public class RunningSearchSolutionExample { * and set the values of these environment variables: */ private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); - private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_API_KEY"); + private static final String ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); private static final String INDEX_NAME = "hotels-sample-index"; private static final String INDEXER_NAME = "hotels-sample-indexer"; diff --git a/sdk/search/azure-search/src/samples/java/com/azure/search/SynonymMapsCreateExample.java b/sdk/search/azure-search/src/samples/java/com/azure/search/SynonymMapsCreateExample.java index 7cabb0d91527..95c420a36490 100644 --- a/sdk/search/azure-search/src/samples/java/com/azure/search/SynonymMapsCreateExample.java +++ b/sdk/search/azure-search/src/samples/java/com/azure/search/SynonymMapsCreateExample.java @@ -23,7 +23,7 @@ public class SynonymMapsCreateExample { * and set the values of these environment variables: */ private static final String ENDPOINT = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ENDPOINT"); - private static final String API_ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_API_KEY"); + private static final String API_ADMIN_KEY = Configuration.getGlobalConfiguration().get("AZURE_COGNITIVE_SEARCH_ADMIN_KEY"); public static void main(String[] args) { SearchServiceClient serviceClient = new SearchServiceClientBuilder() diff --git a/sdk/search/azure-search/src/test/java/com/azure/search/IndexBatchTests.java b/sdk/search/azure-search/src/test/java/com/azure/search/IndexBatchTests.java index 4e1a29ffbf3a..2d5b659e03ec 100644 --- a/sdk/search/azure-search/src/test/java/com/azure/search/IndexBatchTests.java +++ b/sdk/search/azure-search/src/test/java/com/azure/search/IndexBatchTests.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. package com.azure.search; -import com.azure.search.implementation.models.IndexAction; +import com.azure.search.models.IndexAction; import com.azure.search.implementation.models.IndexActionType; import com.azure.search.models.IndexBatch; import org.junit.Assert; diff --git a/sdk/search/open-api/data-readme.md b/sdk/search/open-api/data-readme.md index 7654d4007f50..b9fe9b1af181 100644 --- a/sdk/search/open-api/data-readme.md +++ b/sdk/search/open-api/data-readme.md @@ -23,7 +23,7 @@ sync-methods: none add-context-parameter: true generate-client-interfaces: false custom-types-subpackage: implementation.models -custom-types: IndexActionType,IndexAction,IndexBatchImpl +custom-types: IndexActionType,IndexBatchImpl license-header: |- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.