* If {@code searchText} is set to {@code null} or {@code "*"} all documents will be matched, see
* simple query
- * syntax in Azure Search for more information about search query syntax.
+ * syntax in Azure Cognitive Search for more information about search query syntax.
*
*
properties = CoreUtils.getProperties(SEARCH_PROPERTIES);
@@ -99,12 +97,12 @@ public SearchClientBuilder() {
}
/**
- * Creates a {@link SearchClient} based on options set in the Builder. Every time {@code buildClient()} is
- * called a new instance of {@link SearchClient} is created.
+ * Creates a {@link SearchClient} based on options set in the builder. Every time {@code buildClient()} is called a
+ * new instance of {@link SearchClient} is created.
*
* If {@link #pipeline(HttpPipeline) pipeline} is set, then only the {@code pipeline}, {@link #endpoint(String)
- * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchClient client}.
- * All other builder settings are ignored.
+ * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchClient client}. All other
+ * builder settings are ignored.
*
* @return A SearchClient with the options set from the builder.
* @throws NullPointerException If {@code indexName} or {@code endpoint} are {@code null}.
@@ -114,12 +112,12 @@ public SearchClient buildClient() {
}
/**
- * Creates a {@link SearchAsyncClient} based on options set in the Builder. Every time
- * {@code buildAsyncClient()} is called a new instance of {@link SearchAsyncClient} is created.
+ * Creates a {@link SearchAsyncClient} based on options set in the builder. Every time {@code buildAsyncClient()} is
+ * called a new instance of {@link SearchAsyncClient} is created.
*
* If {@link #pipeline(HttpPipeline) pipeline} is set, then only the {@code pipeline}, {@link #endpoint(String)
- * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchAsyncClient client}.
- * All other builder settings are ignored.
+ * endpoint}, and {@link #indexName(String) indexName} are used to create the {@link SearchAsyncClient client}. All
+ * other builder settings are ignored.
*
* @return A SearchClient with the options set from the builder.
* @throws NullPointerException If {@code indexName} or {@code endpoint} are {@code null}.
@@ -170,9 +168,9 @@ public SearchAsyncClient buildAsyncClient() {
}
/**
- * Sets the service endpoint for the Azure Search instance.
+ * Sets the service endpoint for the Azure Cognitive Search instance.
*
- * @param endpoint The URL of the Azure Search instance.
+ * @param endpoint The URL of the Azure Cognitive Search instance.
* @return The updated SearchClientBuilder object.
* @throws IllegalArgumentException If {@code endpoint} is null or it cannot be parsed into a valid URL.
*/
@@ -307,7 +305,7 @@ public SearchClientBuilder retryPolicy(RetryPolicy retryPolicy) {
* Sets the {@link SearchServiceVersion} that is used when making API requests.
*
* If a service version is not provided, {@link SearchServiceVersion#getLatest()} will be used as a default. When
- * this default is used updating to a newer client library may result in a newer version of the service being used.
+ * the default is used, updating to a newer client library may implicitly use a newer version of the service.
*
* @param serviceVersion The version of the service to be used when making requests.
* @return The updated SearchClientBuilder object.
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java
index c15e2b4b3b18..39a92ae538ab 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchDocument.java
@@ -7,26 +7,22 @@
import java.util.Map;
/**
- * Represents a document
- *
- * A property bag is used for scenarios where the index schema is only known at run-time
- *
- * If the schema is known, user can convert the properties to a specific object type
+ * Represents an untyped document returned from a search or document lookup.
*/
public final class SearchDocument extends HashMap {
private static final long serialVersionUID = 1L;
/**
- * Default empty constructor
+ * Initializes a new instance of the SearchDocument class.
*/
public SearchDocument() {
super();
}
/**
- * Constructs a new {@code Document} with the same mappings as the specified {@code Map}.
+ * Initializes a new instance of the SearchDocument class with initial values.
*
- * @param propertyMap the map whose mappings are to be placed in this map
+ * @param propertyMap Initial values of the document.
*/
public SearchDocument(Map extends String, ?> propertyMap) {
super(propertyMap);
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java
index 0751e21c93a6..bc33b3df930d 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java
@@ -6,7 +6,7 @@
import com.azure.core.util.ServiceVersion;
/**
- * The versions of Azure Search supported by this client library.
+ * The versions of Azure Cognitive Search supported by this client library.
*/
public enum SearchServiceVersion implements ServiceVersion {
V2020_06_30("2020-06-30");
@@ -26,9 +26,9 @@ public String getVersion() {
}
/**
- * Gets the latest service version supported by this client library
+ * Gets the latest service version supported by this client library.
*
- * @return the latest {@link SearchServiceVersion}
+ * @return The latest version supported by this client library.
*/
public static SearchServiceVersion getLatest() {
return V2020_06_30;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java
index c35dd69c612d..a2e67069e3bf 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexAsyncClient.java
@@ -38,7 +38,10 @@
import static com.azure.core.util.FluxUtil.withContext;
/**
- * Asynchronous Client to manage and query indexes, as well as Synonym Map, on a Cognitive Search service
+ * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting
+ * indexes or synonym map and analyzing text in an Azure Cognitive Search service.
+ *
+ * @see SearchIndexClientBuilder
*/
@ServiceClient(builder = SearchIndexClientBuilder.class, isAsync = true)
public final class SearchIndexAsyncClient {
@@ -75,7 +78,7 @@ public final class SearchIndexAsyncClient {
this.restClient = new SearchServiceClientImplBuilder()
.endpoint(endpoint)
- // .apiVersion(serviceVersion.getVersion())
+ // .apiVersion(serviceVersion.getVersion())
.pipeline(httpPipeline)
.buildClient();
}
@@ -308,8 +311,7 @@ public PagedFlux listIndexNames() {
PagedFlux listIndexNames(Context context) {
try {
return new PagedFlux<>(() -> this.listIndexesWithResponse("name", context)
- .map(MappingUtils::mappingPagingSearchIndexNames)
- );
+ .map(MappingUtils::mappingPagingSearchIndexNames));
} catch (RuntimeException ex) {
return pagedFluxError(logger, ex);
}
@@ -371,8 +373,7 @@ Mono> createOrUpdateIndexWithResponse(SearchIndex index, b
String ifMatch = onlyIfUnchanged ? index.getETag() : null;
return restClient.getIndexes()
.createOrUpdateWithResponseAsync(index.getName(), SearchIndexConverter.map(index),
- allowIndexDowntime, ifMatch, null,
- null, context)
+ allowIndexDowntime, ifMatch, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalSearchIndex);
} catch (RuntimeException ex) {
@@ -421,8 +422,7 @@ public Mono> deleteIndexWithResponse(SearchIndex index, boolean o
Mono> deleteIndexWithResponse(String indexName, String etag, Context context) {
try {
return restClient.getIndexes()
- .deleteWithResponseAsync(indexName, etag, null,
- null, context)
+ .deleteWithResponseAsync(indexName, etag, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
@@ -465,8 +465,7 @@ PagedFlux analyzeText(String indexName, AnalyzeTextOptions an
private Mono> analyzeTextWithResponse(String indexName,
AnalyzeTextOptions analyzeTextOptions, Context context) {
return restClient.getIndexes()
- .analyzeWithResponseAsync(indexName, AnalyzeRequestConverter.map(analyzeTextOptions),
- null, context)
+ .analyzeWithResponseAsync(indexName, AnalyzeRequestConverter.map(analyzeTextOptions), null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingTokenInfo);
}
@@ -510,8 +509,7 @@ Mono> createSynonymMapWithResponse(SynonymMap synonymMap,
Objects.requireNonNull(synonymMap, "'SynonymMap' cannot be null.");
try {
return restClient.getSynonymMaps()
- .createWithResponseAsync(SynonymMapConverter.map(synonymMap),
- null, context)
+ .createWithResponseAsync(SynonymMapConverter.map(synonymMap), null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalSynonymMap);
} catch (RuntimeException ex) {
@@ -553,8 +551,7 @@ public Mono> getSynonymMapWithResponse(String synonymMapNam
return withContext(context -> getSynonymMapWithResponse(synonymMapName, context));
}
- Mono> getSynonymMapWithResponse(String synonymMapName,
- Context context) {
+ Mono> getSynonymMapWithResponse(String synonymMapName, Context context) {
try {
return restClient.getSynonymMaps()
.getWithResponseAsync(synonymMapName, null, context)
@@ -627,8 +624,7 @@ PagedFlux listSynonymMapNames(Context context) {
}
}
- private Mono> listSynonymMapsWithResponse(String select,
- Context context) {
+ private Mono> listSynonymMapsWithResponse(String select, Context context) {
return restClient.getSynonymMaps()
.listWithResponseAsync(select, null, context)
.onErrorMap(MappingUtils::exceptionMapper);
@@ -679,9 +675,7 @@ Mono> createOrUpdateSynonymMapWithResponse(SynonymMap synon
try {
return restClient.getSynonymMaps()
.createOrUpdateWithResponseAsync(synonymMap.getName(), SynonymMapConverter.map(synonymMap),
- ifMatch, null,
- null,
- context)
+ ifMatch, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalSynonymMap);
} catch (RuntimeException ex) {
@@ -725,16 +719,14 @@ public Mono deleteSynonymMap(String synonymMapName) {
public Mono> deleteSynonymMapWithResponse(SynonymMap synonymMap, boolean onlyIfUnchanged) {
Objects.requireNonNull(synonymMap, "'SynonymMap' cannot be null");
String etag = onlyIfUnchanged ? synonymMap.getETag() : null;
- return withContext(context ->
- deleteSynonymMapWithResponse(synonymMap.getName(), etag, context));
+ return withContext(context -> deleteSynonymMapWithResponse(synonymMap.getName(), etag, context));
}
Mono> deleteSynonymMapWithResponse(String synonymMapName, String etag,
Context context) {
try {
return restClient.getSynonymMaps()
- .deleteWithResponseAsync(synonymMapName, etag, null,
- null, context)
+ .deleteWithResponseAsync(synonymMapName, etag, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java
index 7988efe02473..e5fde4706f60 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClient.java
@@ -20,7 +20,10 @@
import com.azure.search.documents.indexes.models.SynonymMap;
/**
- * Synchronous Client to manage and query indexes, as well as manage Synonym Map, on a Cognitive Search service
+ * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting
+ * indexes or synonym map and analyzing text in an Azure Cognitive Search service.
+ *
+ * @see SearchIndexClientBuilder
*/
@ServiceClient(builder = SearchIndexClientBuilder.class)
public final class SearchIndexClient {
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java
index c7bcd43d5b1e..a5b20e7ee701 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexClientBuilder.java
@@ -32,16 +32,15 @@
import java.util.Objects;
/**
- * This class provides a fluent builder API to help aid the configuration and instantiation of {@link
- * SearchIndexClient SearchIndexClients} and {@link SearchIndexAsyncClient SearchIndexAsyncClients}. Call {@link
- * #buildClient() buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of
- * the desired client.
+ * This class provides a fluent builder API to help aid the configuration and instantiation of {@link SearchIndexClient
+ * SearchIndexClients} and {@link SearchIndexAsyncClient SearchIndexAsyncClients}. Call {@link #buildClient()
+ * buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of the desired
+ * client.
*
- * The client needs to at least provide the following required fields
- *
+ * The following must be provided to construct a client instance.
*
- * - the service endpoint of the Azure Cognitive Search to access the resource service.
- * - {@link #credential(AzureKeyCredential)} gives the builder access credential.
+ * - The Azure Cognitive Search service URL.
+ * - An {@link AzureKeyCredential} that grants access to the Azure Cognitive Search service.
*
*
* Instantiating an asynchronous Search Index Client
@@ -86,8 +85,8 @@ public final class SearchIndexClientBuilder {
private RetryPolicy retryPolicy;
/**
- * Creates a builder instance that is able to configure and construct {@link SearchIndexClient
- * SearchIndexClients} and {@link SearchIndexAsyncClient SearchIndexAsyncClients}.
+ * Creates a builder instance that is able to configure and construct {@link SearchIndexClient SearchIndexClients}
+ * and {@link SearchIndexAsyncClient SearchIndexAsyncClients}.
*/
public SearchIndexClientBuilder() {
Map properties = CoreUtils.getProperties(SEARCH_PROPERTIES);
@@ -114,8 +113,7 @@ public SearchIndexClient buildClient() {
* buildAsyncClient()} is called a new instance of {@link SearchIndexAsyncClient} is created.
*
* If {@link #pipeline(HttpPipeline) pipeline} is set, then only the {@code pipeline} and {@link #endpoint(String)
- * endpoint} are used to create the {@link SearchIndexAsyncClient client}. All other builder settings are
- * ignored.
+ * endpoint} are used to create the {@link SearchIndexAsyncClient client}. All other builder settings are ignored.
*
* @return A SearchIndexAsyncClient with the options set from the builder.
* @throws NullPointerException If {@code endpoint} are {@code null}.
@@ -165,9 +163,9 @@ public SearchIndexAsyncClient buildAsyncClient() {
}
/**
- * Sets the service endpoint for the Azure Search instance.
+ * Sets the service endpoint for the Azure Cognitive Search instance.
*
- * @param endpoint The URL of the Azure Search instance.
+ * @param endpoint The URL of the Azure Cognitive Search instance.
* @return The updated SearchIndexClientBuilder object.
* @throws IllegalArgumentException If {@code endpoint} is null or it cannot be parsed into a valid URL.
*/
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java
index 141f6096f4f6..ad4d89e99dc8 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerAsyncClient.java
@@ -4,6 +4,7 @@
package com.azure.search.documents.indexes;
import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.rest.PagedFlux;
@@ -35,8 +36,12 @@
import static com.azure.core.util.FluxUtil.withContext;
/**
- * Asynchronous Client to manage and query indexers, as well as manage other resources, on a Cognitive Search service
+ * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting data
+ * source connections, indexers, or skillsets and running or resetting indexers in an Azure Cognitive Search service.
+ *
+ * @see SearchIndexerClientBuilder
*/
+@ServiceClient(builder = SearchIndexerClientBuilder.class, isAsync = true)
public class SearchIndexerAsyncClient {
/**
* Search REST API Version
@@ -70,7 +75,7 @@ public class SearchIndexerAsyncClient {
this.restClient = new SearchServiceClientImplBuilder()
.endpoint(endpoint)
- // .apiVersion(serviceVersion.getVersion())
+ // .apiVersion(serviceVersion.getVersion())
.pipeline(httpPipeline)
.buildClient();
}
@@ -133,8 +138,7 @@ public Mono> createOrUpdateDataSourc
}
Mono> createOrUpdateDataSourceConnectionWithResponse(
- SearchIndexerDataSourceConnection dataSource,
- boolean onlyIfUnchanged, Context context) {
+ SearchIndexerDataSourceConnection dataSource, boolean onlyIfUnchanged, Context context) {
Objects.requireNonNull(dataSource, "'DataSource' cannot be null.");
String ifMatch = onlyIfUnchanged ? dataSource.getETag() : null;
if (dataSource.getConnectionString() == null) {
@@ -143,9 +147,8 @@ Mono> createOrUpdateDataSourceConnec
try {
return restClient
.getDataSources()
- .createOrUpdateWithResponseAsync(dataSource.getName(),
- SearchIndexerDataSourceConverter.map(dataSource), ifMatch, null,
- null, context)
+ .createOrUpdateWithResponseAsync(dataSource.getName(), SearchIndexerDataSourceConverter.map(dataSource),
+ ifMatch, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalDataSource);
} catch (RuntimeException ex) {
@@ -193,8 +196,7 @@ Mono> createDataSourceConnectionWith
SearchIndexerDataSourceConnection dataSource, Context context) {
try {
return restClient.getDataSources()
- .createWithResponseAsync(SearchIndexerDataSourceConverter.map(dataSource),
- null, context)
+ .createWithResponseAsync(SearchIndexerDataSourceConverter.map(dataSource), null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalDataSource);
} catch (RuntimeException ex) {
@@ -237,7 +239,6 @@ public Mono> getDataSourceConnection
return withContext(context -> getDataSourceConnectionWithResponse(dataSourceName, context));
}
- @ServiceMethod(returns = ReturnType.SINGLE)
Mono> getDataSourceConnectionWithResponse(String dataSourceName,
Context context) {
try {
@@ -292,6 +293,7 @@ PagedFlux listDataSourceConnections(Context c
*
* @return a list of DataSource names
*/
+ @ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listDataSourceConnectionNames() {
try {
return new PagedFlux<>(() ->
@@ -332,8 +334,8 @@ private Mono> listDataSourceConnectionsWithRespo
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono deleteDataSourceConnection(String dataSourceName) {
- return withContext(context ->
- deleteDataSourceConnectionWithResponse(dataSourceName, null, context).flatMap(FluxUtil::toMono));
+ return withContext(context -> deleteDataSourceConnectionWithResponse(dataSourceName, null, context)
+ .flatMap(FluxUtil::toMono));
}
/**
@@ -355,19 +357,13 @@ public Mono> deleteDataSourceConnectionWithResponse(SearchIndexer
boolean onlyIfUnchanged) {
Objects.requireNonNull(dataSource, "'DataSource' cannot be null");
String etag = onlyIfUnchanged ? dataSource.getETag() : null;
- return withContext(context ->
- deleteDataSourceConnectionWithResponse(dataSource.getName(), etag, context));
+ return withContext(context -> deleteDataSourceConnectionWithResponse(dataSource.getName(), etag, context));
}
- Mono> deleteDataSourceConnectionWithResponse(String dataSourceName, String etag,
- Context context) {
+ Mono> deleteDataSourceConnectionWithResponse(String dataSourceName, String etag, Context context) {
try {
return restClient.getDataSources()
- .deleteWithResponseAsync(
- dataSourceName,
- etag, null,
- null,
- context)
+ .deleteWithResponseAsync(dataSourceName, etag, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
@@ -409,12 +405,10 @@ public Mono> createIndexerWithResponse(SearchIndexer ind
return withContext(context -> createIndexerWithResponse(indexer, context));
}
- Mono> createIndexerWithResponse(SearchIndexer indexer,
- Context context) {
+ Mono> createIndexerWithResponse(SearchIndexer indexer, Context context) {
try {
return restClient.getIndexers()
- .createWithResponseAsync(SearchIndexerConverter.map(indexer),
- null, context)
+ .createWithResponseAsync(SearchIndexerConverter.map(indexer), null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalSearchIndexer);
} catch (RuntimeException ex) {
@@ -456,8 +450,7 @@ public Mono createOrUpdateIndexer(SearchIndexer indexer) {
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> createOrUpdateIndexerWithResponse(SearchIndexer indexer,
boolean onlyIfUnchanged) {
- return withContext(context ->
- createOrUpdateIndexerWithResponse(indexer, onlyIfUnchanged, context));
+ return withContext(context -> createOrUpdateIndexerWithResponse(indexer, onlyIfUnchanged, context));
}
Mono> createOrUpdateIndexerWithResponse(SearchIndexer indexer, boolean onlyIfUnchanged,
@@ -466,10 +459,8 @@ Mono> createOrUpdateIndexerWithResponse(SearchIndexer in
String ifMatch = onlyIfUnchanged ? indexer.getETag() : null;
try {
return restClient.getIndexers()
- .createOrUpdateWithResponseAsync(indexer.getName(), SearchIndexerConverter.map(indexer), ifMatch,
- null,
- null,
- context)
+ .createOrUpdateWithResponseAsync(indexer.getName(), SearchIndexerConverter.map(indexer), ifMatch, null,
+ null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalSearchIndexer);
} catch (RuntimeException ex) {
@@ -511,8 +502,7 @@ public Mono> getIndexerWithResponse(String indexerName)
return withContext(context -> getIndexerWithResponse(indexerName, context));
}
- Mono> getIndexerWithResponse(String indexerName,
- Context context) {
+ Mono> getIndexerWithResponse(String indexerName, Context context) {
try {
return restClient.getIndexers()
.getWithResponseAsync(indexerName, null, context)
@@ -585,8 +575,7 @@ PagedFlux listIndexerNames(Context context) {
}
}
- private Mono> listIndexersWithResponse(String select,
- Context context) {
+ private Mono> listIndexersWithResponse(String select, Context context) {
return restClient.getIndexers()
.listWithResponseAsync(select, null, context)
.onErrorMap(MappingUtils::exceptionMapper);
@@ -639,12 +628,10 @@ public Mono> deleteIndexerWithResponse(SearchIndexer indexer, boo
* @param context the context
* @return a response signalling completion.
*/
- Mono> deleteIndexerWithResponse(String indexerName, String etag,
- Context context) {
+ Mono> deleteIndexerWithResponse(String indexerName, String etag, Context context) {
try {
return restClient.getIndexers()
- .deleteWithResponseAsync(indexerName, etag, null,
- null, context)
+ .deleteWithResponseAsync(indexerName, etag, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
@@ -733,8 +720,7 @@ public Mono> runIndexerWithResponse(String indexerName) {
Mono> runIndexerWithResponse(String indexerName, Context context) {
try {
- return restClient.getIndexers().runWithResponseAsync(indexerName,
- null, context)
+ return restClient.getIndexers().runWithResponseAsync(indexerName, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
@@ -776,12 +762,10 @@ public Mono> getIndexerStatusWithResponse(String i
return withContext(context -> getIndexerStatusWithResponse(indexerName, context));
}
- Mono> getIndexerStatusWithResponse(String indexerName,
- Context context) {
+ Mono> getIndexerStatusWithResponse(String indexerName, Context context) {
try {
return restClient.getIndexers()
- .getStatusWithResponseAsync(indexerName, null,
- context)
+ .getStatusWithResponseAsync(indexerName, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingIndexerStatus);
} catch (RuntimeException ex) {
@@ -823,13 +807,11 @@ public Mono> createSkillsetWithResponse(SearchIn
return withContext(context -> createSkillsetWithResponse(skillset, context));
}
- Mono> createSkillsetWithResponse(SearchIndexerSkillset skillset,
- Context context) {
+ Mono> createSkillsetWithResponse(SearchIndexerSkillset skillset, Context context) {
Objects.requireNonNull(skillset, "'Skillset' cannot be null.");
try {
return restClient.getSkillsets()
- .createWithResponseAsync(SearchIndexerSkillsetConverter.map(skillset),
- null, context)
+ .createWithResponseAsync(SearchIndexerSkillsetConverter.map(skillset), null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalSkillset);
} catch (RuntimeException ex) {
@@ -871,8 +853,7 @@ public Mono> getSkillsetWithResponse(String skil
return withContext(context -> getSkillsetWithResponse(skillsetName, context));
}
- Mono> getSkillsetWithResponse(String skillsetName,
- Context context) {
+ Mono> getSkillsetWithResponse(String skillsetName, Context context) {
try {
return this.restClient.getSkillsets()
.getWithResponseAsync(skillsetName, null, context)
@@ -985,8 +966,7 @@ public Mono createOrUpdateSkillset(SearchIndexerSkillset
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> createOrUpdateSkillsetWithResponse(SearchIndexerSkillset skillset,
boolean onlyIfUnchanged) {
- return withContext(context ->
- createOrUpdateSkillsetWithResponse(skillset, onlyIfUnchanged, context));
+ return withContext(context -> createOrUpdateSkillsetWithResponse(skillset, onlyIfUnchanged, context));
}
Mono> createOrUpdateSkillsetWithResponse(SearchIndexerSkillset skillset,
@@ -996,9 +976,7 @@ Mono> createOrUpdateSkillsetWithResponse(SearchI
try {
return restClient.getSkillsets()
.createOrUpdateWithResponseAsync(skillset.getName(), SearchIndexerSkillsetConverter.map(skillset),
- ifMatch, null,
- null,
- context)
+ ifMatch, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(MappingUtils::mappingExternalSkillset);
} catch (RuntimeException ex) {
@@ -1042,16 +1020,13 @@ public Mono deleteSkillset(String skillsetName) {
public Mono> deleteSkillsetWithResponse(SearchIndexerSkillset skillset, boolean onlyIfUnchanged) {
Objects.requireNonNull(skillset, "'Skillset' cannot be null.");
String etag = onlyIfUnchanged ? skillset.getETag() : null;
- return withContext(context ->
- deleteSkillsetWithResponse(skillset.getName(), etag, context));
+ return withContext(context -> deleteSkillsetWithResponse(skillset.getName(), etag, context));
}
- Mono> deleteSkillsetWithResponse(String skillsetName, String etag,
- Context context) {
+ Mono> deleteSkillsetWithResponse(String skillsetName, String etag, Context context) {
try {
return restClient.getSkillsets()
- .deleteWithResponseAsync(skillsetName, etag, null,
- null, context)
+ .deleteWithResponseAsync(skillsetName, etag, null, null, context)
.onErrorMap(MappingUtils::exceptionMapper)
.map(Function.identity());
} catch (RuntimeException ex) {
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java
index 819cdf381f3c..c04749b1389a 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClient.java
@@ -4,6 +4,7 @@
package com.azure.search.documents.indexes;
import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.rest.PagedIterable;
@@ -15,8 +16,12 @@
import com.azure.search.documents.indexes.models.SearchIndexerStatus;
/**
- * Synchronous Client to manage and query indexers, as well as manage other resources, on a Cognitive Search service
+ * This class provides a client that contains the operations for creating, getting, listing, updating, or deleting data
+ * source connections, indexers, or skillsets and running or resetting indexers in an Azure Cognitive Search service.
+ *
+ * @see SearchIndexerClientBuilder
*/
+@ServiceClient(builder = SearchIndexerClientBuilder.class)
public class SearchIndexerClient {
private final SearchIndexerAsyncClient asyncClient;
@@ -57,8 +62,7 @@ public String getEndpoint() {
@ServiceMethod(returns = ReturnType.SINGLE)
public SearchIndexerDataSourceConnection createOrUpdateDataSourceConnection(
SearchIndexerDataSourceConnection dataSourceConnection) {
- return createOrUpdateDataSourceConnectionWithResponse(dataSourceConnection, false,
- Context.NONE).getValue();
+ return createOrUpdateDataSourceConnectionWithResponse(dataSourceConnection, false, Context.NONE).getValue();
}
/**
@@ -236,7 +240,7 @@ public PagedIterable listDataSourceConnectionNames(Context context) {
*
* @param dataSourceConnectionName the name of the data source to be deleted
*/
- @ServiceMethod(returns = ReturnType.COLLECTION)
+ @ServiceMethod(returns = ReturnType.SINGLE)
public void deleteDataSourceConnection(String dataSourceConnectionName) {
deleteDataSourceConnectionWithResponse(new SearchIndexerDataSourceConnection(dataSourceConnectionName), false,
Context.NONE);
@@ -262,8 +266,8 @@ public void deleteDataSourceConnection(String dataSourceConnectionName) {
public Response deleteDataSourceConnectionWithResponse(SearchIndexerDataSourceConnection dataSourceConnection,
boolean onlyIfUnchanged, Context context) {
String etag = onlyIfUnchanged ? dataSourceConnection.getETag() : null;
- return asyncClient.deleteDataSourceConnectionWithResponse(dataSourceConnection.getName(), etag,
- context).block();
+ return asyncClient.deleteDataSourceConnectionWithResponse(dataSourceConnection.getName(), etag, context)
+ .block();
}
/**
@@ -297,8 +301,7 @@ public SearchIndexer createIndexer(SearchIndexer indexer) {
* @return a response containing the created Indexer.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response createIndexerWithResponse(SearchIndexer indexer,
- Context context) {
+ public Response createIndexerWithResponse(SearchIndexer indexer, Context context) {
return asyncClient.createIndexerWithResponse(indexer, context).block();
}
@@ -437,8 +440,7 @@ public SearchIndexer getIndexer(String indexerName) {
* @return a response containing the indexer.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getIndexerWithResponse(String indexerName,
- Context context) {
+ public Response getIndexerWithResponse(String indexerName, Context context) {
return asyncClient.getIndexerWithResponse(indexerName, context).block();
}
@@ -474,8 +476,7 @@ public void deleteIndexer(String indexerName) {
* @return a response signalling completion.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response deleteIndexerWithResponse(SearchIndexer indexer, boolean onlyIfUnchanged,
- Context context) {
+ public Response deleteIndexerWithResponse(SearchIndexer indexer, boolean onlyIfUnchanged, Context context) {
String etag = onlyIfUnchanged ? indexer.getETag() : null;
return asyncClient.deleteIndexerWithResponse(indexer.getName(), etag, context).block();
}
@@ -579,8 +580,7 @@ public SearchIndexerStatus getIndexerStatus(String indexerName) {
* @return a response with the indexer execution info.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getIndexerStatusWithResponse(String indexerName,
- Context context) {
+ public Response getIndexerStatusWithResponse(String indexerName, Context context) {
return asyncClient.getIndexerStatusWithResponse(indexerName, context).block();
}
@@ -616,8 +616,7 @@ public SearchIndexerSkillset createSkillset(SearchIndexerSkillset skillset) {
* @return a response containing the created SearchIndexerSkillset.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response createSkillsetWithResponse(SearchIndexerSkillset skillset,
- Context context) {
+ public Response createSkillsetWithResponse(SearchIndexerSkillset skillset, Context context) {
return asyncClient.createSkillsetWithResponse(skillset, context).block();
}
@@ -652,8 +651,7 @@ public SearchIndexerSkillset getSkillset(String skillsetName) {
* @return a response containing the SearchIndexerSkillset.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response getSkillsetWithResponse(String skillsetName,
- Context context) {
+ public Response getSkillsetWithResponse(String skillsetName, Context context) {
return asyncClient.getSkillsetWithResponse(skillsetName, context).block();
}
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java
index 7874238e497f..f83a3f743d97 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerClientBuilder.java
@@ -38,11 +38,10 @@
* #buildClient() buildClient} and {@link #buildAsyncClient() buildAsyncClient} respectively to construct an instance of
* the desired client.
*
- * The client needs to at least provide the following required fields
- *
+ * The following must be provided to construct a client instance.
*
- * - the service endpoint of the Azure Cognitive Search to access the resource service.
- * - {@link #credential(AzureKeyCredential)} gives the builder access credential.
+ * - The Azure Cognitive Search service URL.
+ * - An {@link AzureKeyCredential} that grants access to the Azure Cognitive Search service.
*
*
* Instantiating an asynchronous Search Indexer Client
@@ -166,9 +165,9 @@ public SearchIndexerAsyncClient buildAsyncClient() {
}
/**
- * Sets the service endpoint for the Azure Search instance.
+ * Sets the service endpoint for the Azure Cognitive Search instance.
*
- * @param endpoint The URL of the Azure Search instance.
+ * @param endpoint The URL of the Azure Cognitive Search instance.
* @return The updated SearchIndexerClientBuilder object.
* @throws IllegalArgumentException If {@code endpoint} is null or it cannot be parsed into a valid URL.
*/
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java
index 82b6746da476..92a35395bdf1 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/SearchIndexerDataSources.java
@@ -12,7 +12,8 @@
import com.azure.search.documents.indexes.models.SearchIndexerDataSourceType;
/**
- * Utility class that aids in the creation of {@link SearchIndexerDataSourceConnection SearchIndexerDataSources}.
+ * Utility class that aids in the creation of {@link SearchIndexerDataSourceConnection
+ * SearchIndexerDataSourceConnections}.
*/
public final class SearchIndexerDataSources {
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java
index a95b4570dd2c..cf1d4ff54de3 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/package-info.java
@@ -2,8 +2,7 @@
// Licensed under the MIT License.
/**
- * Package containing the data models for SearchServiceRestClient.
- * Client that can be used to manage and query indexes and documents, as well
- * as manage other resources, on a search service.
+ * Package containing classes used for resource management operations that are being sent-to and received-from an
+ * Azure Cognitive Search service.
*/
package com.azure.search.documents.indexes.models;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java
index f3976eff94c2..d970f63ef906 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/package-info.java
@@ -2,7 +2,10 @@
// Licensed under the MIT License.
/**
- * Package containing the annotations used by FieldBuilder which help convert
- * model class to a list of Field classes for building Index.
+ * Package containing classes for creating {@link com.azure.search.documents.indexes.SearchIndexClient},
+ * {@link com.azure.search.documents.indexes.SearchIndexAsyncClient},
+ * {@link com.azure.search.documents.indexes.SearchIndexerClient}, or
+ * {@link com.azure.search.documents.indexes.SearchIndexerAsyncClient} used to perform resource management operations
+ * on an Azure Cognitive Search service.
*/
package com.azure.search.documents.indexes;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java
new file mode 100644
index 000000000000..a052f26e2a17
--- /dev/null
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/models/package-info.java
@@ -0,0 +1,8 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+/**
+ * Package containing classes used for document management, autocomplete, search, or suggestion operations that are
+ * being sent-to and received-from an Azure Cognitive Search service index.
+ */
+package com.azure.search.documents.models;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java
index 11f33ee1ee8c..38b8b14ef0e8 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/package-info.java
@@ -5,7 +5,8 @@
// regenerated.
/**
- * Package containing the classes for SearchIndexRestClient. Client that can be used to query an index and upload,
- * merge, or delete documents.
+ * Package containing classes for creating {@link com.azure.search.documents.SearchClient} or
+ * {@link com.azure.search.documents.SearchAsyncClient} used to perform document management, autocomplete, search, or
+ * suggestion operations using an Azure Cognitive Search service index.
*/
package com.azure.search.documents;
diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java
index a60d24405cd5..800c51a81b69 100644
--- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java
+++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/util/package-info.java
@@ -2,6 +2,6 @@
// Licensed under the MIT License.
/**
- * Package containing Search utility classes.
+ * Package containing Azure Cognitive Search paged response classes.
*/
package com.azure.search.documents.util;
diff --git a/sdk/search/azure-search-documents/src/main/java/module-info.java b/sdk/search/azure-search-documents/src/main/java/module-info.java
index a25a9e84ecf5..44e0917971da 100644
--- a/sdk/search/azure-search-documents/src/main/java/module-info.java
+++ b/sdk/search/azure-search-documents/src/main/java/module-info.java
@@ -17,6 +17,7 @@
opens com.azure.search.documents.implementation.util to com.fasterxml.jackson.databind;
exports com.azure.search.documents;
+ exports com.azure.search.documents.indexes;
exports com.azure.search.documents.indexes.models;
exports com.azure.search.documents.models;
exports com.azure.search.documents.util;
diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java
index 88ce4b28826b..b830c0748fa3 100644
--- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java
+++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RefineSearchCapabilitiesExample.java
@@ -31,7 +31,7 @@
/**
* This scenario assumes an existing search solution, with index and an indexer setup (see LifecycleSetupExample)
- * For more information visit Azure Search Sample Data
+ * For more information visit Azure Cognitive Search Sample Data
* https://docs.microsoft.com/en-us/samples/azure-samples/azure-search-sample-data/azure-search-sample-data/
*/
public class RefineSearchCapabilitiesExample {
diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java
index 259ba3ab0fd2..9e5fe4c57710 100644
--- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java
+++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/RunningSearchSolutionExample.java
@@ -27,7 +27,7 @@
/**
* This scenario assumes an existing search solution, with index and an indexer setup (see LifecycleSetupExample)
- * Azure Search Sample Data
+ * Azure Cognitive Search Sample Data
* https://docs.microsoft.com/en-us/samples/azure-samples/azure-search-sample-data/azure-search-sample-data/
*/
public class RunningSearchSolutionExample {
diff --git a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java
index c6acd454d1b8..eff3c0a9775d 100644
--- a/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java
+++ b/sdk/search/azure-search-documents/src/samples/java/com/azure/search/documents/indexes/LifecycleSetupExample.java
@@ -29,7 +29,7 @@
/**
* This scenario assumes an existing search solution and uses a pre-population data source with sample data set
- * For more information visit Azure Search Sample Data:
+ * For more information visit Azure Cognitive Search Sample Data:
* https://docs.microsoft.com/en-us/samples/azure-samples/azure-search-sample-data/azure-search-sample-data/
*/
public class LifecycleSetupExample {
diff --git a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java
index da20ef304172..d31986de974c 100644
--- a/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java
+++ b/sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/TestHelpers.java
@@ -39,7 +39,7 @@
import static org.junit.jupiter.api.Assertions.fail;
/**
- * This class contains helper methods for running Azure Search tests.
+ * This class contains helper methods for running Azure Cognitive Search tests.
*/
public final class TestHelpers {
private static final TestMode TEST_MODE = setupTestMode();