Skip to content

Commit d11329c

Browse files
authored
Regenerate and Include New Skillsets (Azure#22945)
Regenerate and Include New Skillsets
1 parent a45d691 commit d11329c

File tree

335 files changed

+13303
-11826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+13303
-11826
lines changed

eng/code-quality-reports/src/main/resources/revapi/revapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@
549549
},
550550
{
551551
"code": "java.method.added",
552-
"new": "method com.azure.core.util.HttpClientOptions com.azure.core.util.HttpClientOptions::setResponseTimeout(java.time.Duration)",
553-
"justification": "New Setter method."
552+
"new": "method com.azure.core.util.HttpClientOptions com.azure.core.util.HttpClientOptions::setResponseTimeout(java.time.Duration)",
553+
"justification": "New Setter method."
554554
},
555555
{
556556
"code": "java.annotation.attributeValueChanged",

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchAsyncClient.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,9 @@ private static SearchRequest createSearchRequest(String searchText, SearchOption
841841
.setSessionId(options.getSessionId())
842842
.setSelect(nullSafeStringJoin(options.getSelect()))
843843
.setSkip(options.getSkip())
844-
.setTop(options.getTop());
844+
.setTop(options.getTop())
845+
.setCaptions(options.getCaptions())
846+
.setSemanticFields(nullSafeStringJoin(options.getSemanticFields()));
845847
}
846848

847849
private static String createSearchRequestAnswers(SearchOptions searchOptions) {

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/SearchServiceVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
public enum SearchServiceVersion implements ServiceVersion {
1212
V2020_06_30("2020-06-30"),
13-
V2020_06_30_PREVIEW("2020-06-30-Preview");
13+
V2021_04_30_PREVIEW("2021-04-30-Preview");
1414

1515
private final String version;
1616

@@ -32,6 +32,6 @@ public String getVersion() {
3232
* @return The latest version supported by this client library.
3333
*/
3434
public static SearchServiceVersion getLatest() {
35-
return V2020_06_30_PREVIEW;
35+
return V2021_04_30_PREVIEW;
3636
}
3737
}

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/DocumentsImpl.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.azure.search.documents.models.AutocompleteMode;
3838
import com.azure.search.documents.models.AutocompleteOptions;
3939
import com.azure.search.documents.models.AutocompleteResult;
40+
import com.azure.search.documents.models.Captions;
4041
import com.azure.search.documents.models.QueryLanguage;
4142
import com.azure.search.documents.models.QuerySpeller;
4243
import com.azure.search.documents.models.QueryType;
@@ -112,6 +113,8 @@ Mono<Response<SearchDocumentsResult>> searchGet(
112113
@QueryParam("$select") String select,
113114
@QueryParam("$skip") Integer skip,
114115
@QueryParam("$top") Integer top,
116+
@QueryParam("captions") Captions captions,
117+
@QueryParam("semanticFields") String semanticFields,
115118
@QueryParam("api-version") String apiVersion,
116119
@HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
117120
@HeaderParam("Accept") String accept,
@@ -370,6 +373,16 @@ public Mono<Response<SearchDocumentsResult>> searchGetWithResponseAsync(
370373
topInternal = searchOptions.getTop();
371374
}
372375
Integer top = topInternal;
376+
Captions captionsInternal = null;
377+
if (searchOptions != null) {
378+
captionsInternal = searchOptions.getCaptions();
379+
}
380+
Captions captions = captionsInternal;
381+
List<String> semanticFieldsInternal = null;
382+
if (searchOptions != null) {
383+
semanticFieldsInternal = searchOptions.getSemanticFields();
384+
}
385+
List<String> semanticFields = semanticFieldsInternal;
373386
UUID xMsClientRequestIdInternal = null;
374387
if (requestOptions != null) {
375388
xMsClientRequestIdInternal = requestOptions.getXMsClientRequestId();
@@ -387,6 +400,8 @@ public Mono<Response<SearchDocumentsResult>> searchGetWithResponseAsync(
387400
JacksonAdapter.createDefaultSerializerAdapter().serializeList(searchFields, CollectionFormat.CSV);
388401
String selectConverted =
389402
JacksonAdapter.createDefaultSerializerAdapter().serializeList(select, CollectionFormat.CSV);
403+
String semanticFieldsConverted =
404+
JacksonAdapter.createDefaultSerializerAdapter().serializeList(semanticFields, CollectionFormat.CSV);
390405
return service.searchGet(
391406
this.client.getEndpoint(),
392407
this.client.getIndexName(),
@@ -412,6 +427,8 @@ public Mono<Response<SearchDocumentsResult>> searchGetWithResponseAsync(
412427
selectConverted,
413428
skip,
414429
top,
430+
captions,
431+
semanticFieldsConverted,
415432
this.client.getApiVersion(),
416433
xMsClientRequestId,
417434
accept,

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/SearchIndexClientImplBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public SearchIndexClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy) {
208208
*/
209209
public SearchIndexClientImpl buildClient() {
210210
if (apiVersion == null) {
211-
this.apiVersion = "2020-06-30-Preview";
211+
this.apiVersion = "2021-04-30-Preview";
212212
}
213213
if (pipeline == null) {
214214
this.pipeline = createHttpPipeline();

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchOptions.java

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package com.azure.search.documents.implementation.models;
88

99
import com.azure.core.annotation.Fluent;
10+
import com.azure.search.documents.models.Captions;
1011
import com.azure.search.documents.models.QueryLanguage;
1112
import com.azure.search.documents.models.QuerySpeller;
1213
import com.azure.search.documents.models.QueryType;
@@ -193,6 +194,23 @@ public final class SearchOptions {
193194
@JsonProperty(value = "$top")
194195
private Integer top;
195196

197+
/*
198+
* This parameter is only valid if the query type is 'semantic'. If set,
199+
* the query returns captions extracted from key passages in the highest
200+
* ranked documents. When Captions is set to 'extractive', highlighting is
201+
* enabled by default, and can be configured by appending the pipe
202+
* character '|' followed by the 'highlight-<true/false>' option, such as
203+
* 'extractive|highlight-true'. Defaults to 'None'.
204+
*/
205+
@JsonProperty(value = "captions")
206+
private Captions captions;
207+
208+
/*
209+
* The list of field names used for semantic search.
210+
*/
211+
@JsonProperty(value = "semanticFields")
212+
private List<String> semanticFields;
213+
196214
/**
197215
* Get the includeTotalCount property: A value that specifies whether to fetch the total count of results. Default
198216
* is false. Setting this value to true may have a performance impact. Note that the count returned is an
@@ -676,4 +694,50 @@ public SearchOptions setTop(Integer top) {
676694
this.top = top;
677695
return this;
678696
}
697+
698+
/**
699+
* Get the captions property: This parameter is only valid if the query type is 'semantic'. If set, the query
700+
* returns captions extracted from key passages in the highest ranked documents. When Captions is set to
701+
* 'extractive', highlighting is enabled by default, and can be configured by appending the pipe character '|'
702+
* followed by the 'highlight-&lt;true/false&gt;' option, such as 'extractive|highlight-true'. Defaults to 'None'.
703+
*
704+
* @return the captions value.
705+
*/
706+
public Captions getCaptions() {
707+
return this.captions;
708+
}
709+
710+
/**
711+
* Set the captions property: This parameter is only valid if the query type is 'semantic'. If set, the query
712+
* returns captions extracted from key passages in the highest ranked documents. When Captions is set to
713+
* 'extractive', highlighting is enabled by default, and can be configured by appending the pipe character '|'
714+
* followed by the 'highlight-&lt;true/false&gt;' option, such as 'extractive|highlight-true'. Defaults to 'None'.
715+
*
716+
* @param captions the captions value to set.
717+
* @return the SearchOptions object itself.
718+
*/
719+
public SearchOptions setCaptions(Captions captions) {
720+
this.captions = captions;
721+
return this;
722+
}
723+
724+
/**
725+
* Get the semanticFields property: The list of field names used for semantic search.
726+
*
727+
* @return the semanticFields value.
728+
*/
729+
public List<String> getSemanticFields() {
730+
return this.semanticFields;
731+
}
732+
733+
/**
734+
* Set the semanticFields property: The list of field names used for semantic search.
735+
*
736+
* @param semanticFields the semanticFields value to set.
737+
* @return the SearchOptions object itself.
738+
*/
739+
public SearchOptions setSemanticFields(List<String> semanticFields) {
740+
this.semanticFields = semanticFields;
741+
return this;
742+
}
679743
}

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/models/SearchRequest.java

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package com.azure.search.documents.implementation.models;
88

99
import com.azure.core.annotation.Fluent;
10+
import com.azure.search.documents.models.Captions;
1011
import com.azure.search.documents.models.QueryLanguage;
1112
import com.azure.search.documents.models.QuerySpeller;
1213
import com.azure.search.documents.models.QueryType;
@@ -203,6 +204,19 @@ public final class SearchRequest {
203204
@JsonProperty(value = "top")
204205
private Integer top;
205206

207+
/*
208+
* A value that specifies whether captions should be returned as part of
209+
* the search response.
210+
*/
211+
@JsonProperty(value = "captions")
212+
private Captions captions;
213+
214+
/*
215+
* The comma-separated list of field names used for semantic search.
216+
*/
217+
@JsonProperty(value = "semanticFields")
218+
private String semanticFields;
219+
206220
/**
207221
* Get the includeTotalResultCount property: A value that specifies whether to fetch the total count of results.
208222
* Default is false. Setting this value to true may have a performance impact. Note that the count returned is an
@@ -714,4 +728,46 @@ public SearchRequest setTop(Integer top) {
714728
this.top = top;
715729
return this;
716730
}
731+
732+
/**
733+
* Get the captions property: A value that specifies whether captions should be returned as part of the search
734+
* response.
735+
*
736+
* @return the captions value.
737+
*/
738+
public Captions getCaptions() {
739+
return this.captions;
740+
}
741+
742+
/**
743+
* Set the captions property: A value that specifies whether captions should be returned as part of the search
744+
* response.
745+
*
746+
* @param captions the captions value to set.
747+
* @return the SearchRequest object itself.
748+
*/
749+
public SearchRequest setCaptions(Captions captions) {
750+
this.captions = captions;
751+
return this;
752+
}
753+
754+
/**
755+
* Get the semanticFields property: The comma-separated list of field names used for semantic search.
756+
*
757+
* @return the semanticFields value.
758+
*/
759+
public String getSemanticFields() {
760+
return this.semanticFields;
761+
}
762+
763+
/**
764+
* Set the semanticFields property: The comma-separated list of field names used for semantic search.
765+
*
766+
* @param semanticFields the semanticFields value to set.
767+
* @return the SearchRequest object itself.
768+
*/
769+
public SearchRequest setSemanticFields(String semanticFields) {
770+
this.semanticFields = semanticFields;
771+
return this;
772+
}
717773
}

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,12 @@ private static List<SearchField> build(Class<?> currentClass, Stack<Class<?>> cl
111111
LOGGER.warning("There is circular dependencies {}, {}", classChain, currentClass);
112112
return null;
113113
}
114+
114115
if (classChain.size() > MAX_DEPTH) {
115116
throw LOGGER.logExceptionAsError(new RuntimeException(
116117
"The dependency graph is too deep. Please review your schema."));
117118
}
119+
118120
classChain.push(currentClass);
119121
List<SearchField> searchFields = getDeclaredFieldsAndMethods(currentClass)
120122
.filter(FieldBuilder::fieldOrMethodIgnored)
@@ -240,23 +242,18 @@ private static Type getComponentOrElementType(Type arrayOrListType) {
240242
}
241243

242244
private static SearchField convertToBasicSearchField(String fieldName, Type type) {
243-
244245
SearchFieldDataType dataType = covertToSearchFieldDataType(type, false);
245-
if (dataType == null) {
246-
return null;
247-
}
248246

249-
return new SearchField(fieldName, dataType);
247+
return (dataType == null) ? null : new SearchField(fieldName, dataType);
250248
}
251249

252250
private static SearchField enrichWithAnnotation(SearchField searchField, Member member) {
253251
SimpleField simpleField = getDeclaredAnnotation(member, SimpleField.class);
254252
SearchableField searchableField = getDeclaredAnnotation(member, SearchableField.class);
255253

256254
if (simpleField != null && searchableField != null) {
257-
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
258-
String.format("@SimpleFieldProperty and @SearchableFieldProperty cannot be present simultaneously "
259-
+ "for %s", member.getName())));
255+
throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format(
256+
"@SimpleField and @SearchableField cannot be present simultaneously for %s", member.getName())));
260257
}
261258
if (simpleField != null) {
262259
searchField.setSearchable(false)
@@ -268,9 +265,9 @@ private static SearchField enrichWithAnnotation(SearchField searchField, Member
268265
} else if (searchableField != null) {
269266
if (!searchField.getType().equals(SearchFieldDataType.STRING)
270267
&& !searchField.getType().equals(SearchFieldDataType.collection(SearchFieldDataType.STRING))) {
271-
throw LOGGER.logExceptionAsError(new RuntimeException(String.format("SearchFieldProperty can only"
272-
+ " be used on string properties. Property %s returns a %s value.",
273-
member.getName(), searchField.getType())));
268+
throw LOGGER.logExceptionAsError(new RuntimeException(String.format("SearchField can only be used on "
269+
+ "string properties. Property %s returns a %s value.", member.getName(),
270+
searchField.getType())));
274271
}
275272

276273
searchField.setSearchable(true)

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/implementation/SearchServiceClientImplBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public SearchServiceClientImplBuilder addPolicy(HttpPipelinePolicy customPolicy)
192192
*/
193193
public SearchServiceClientImpl buildClient() {
194194
if (apiVersion == null) {
195-
this.apiVersion = "2020-06-30-Preview";
195+
this.apiVersion = "2021-04-30-Preview";
196196
}
197197
if (pipeline == null) {
198198
this.pipeline = createHttpPipeline();

0 commit comments

Comments
 (0)