Skip to content

Commit edbe415

Browse files
idickerson7Robert Lee
andauthored
Idickers/2025-11-01-preview-sdk-gen-java (Azure#47057)
* Autorest generated code and some changes * breaking change fixes * autorest regeneration with most recent SHA+ updated knowledgebases namespace * Clean state before full Agent→Base replacement * KA -> KB rename completed * clean build after fixing errors from KA->KB rename * Adress some PR comments, need to regenerate searchservice to delete incorrectly placed files * regen of searchservice.json * changes made to all confirmed PR comments * remove unnecessary change in readme * update CHANGELOG.md * deleted KnowledgeAgentTests, added clientbuilder files, removed mention of classes used by KBTests that were deleted by swagger * First tests * spotless cleanup * commit before regen with newest hash * commit after autorest regeneration with latest hash * update latest preview version to 2025-11-01 * regen and rebuild to push changes to pipeline * update old preview version used in compatability tests * rebuild for pipeline * add some tests for review * commit before deploying to stamp * tests done and verified * PR comment changes * resolve conflicts * add remote sharepoint tests * add reasoning effort * last minute changes * updated assets * fix cspell error * fix failed checks * re-record all tests * last generation * fix tests and run linting suppression * fix tests and add apackage-info to knowledgebases * fix minor syntax error * address checkstyle issue * address checkstyle issue --------- Co-authored-by: Robert Lee <[email protected]>
1 parent 0e6e838 commit edbe415

File tree

169 files changed

+15227
-4094
lines changed

Some content is hidden

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

169 files changed

+15227
-4094
lines changed

sdk/search/azure-search-documents/CHANGELOG.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
11
# Release History
22

3-
## 11.9.0-beta.1 (Unreleased)
3+
## 11.9.0-beta.1 (2025-11-17)
44

55
### Features Added
66

77
- Added back all service preview features dropped in `2025-09-01` service version release.
8+
- Added optional parameter `x-ms-enable-elevated-read` for elevated read access that bypasses document-level permission checks.
9+
- Added statistical aggregation properties to `FacetResult`: `avg`, `min`, `max`, and `cardinality` for enhanced analytics.
10+
- Added support for new Azure OpenAI models: `gpt-5`, `gpt-5-mini`, and `gpt-5-nano`.
11+
- Added support for `sharepoint` data source type in `SearchIndexerDataSourceType`.
12+
- Added support for new `KnowledgeSourceKind` types: `web`, `remoteSharePoint`, `indexedSharePoint`, and `indexedOneLake`.
13+
- Added `purviewEnabled` property to `SearchIndex` for Microsoft Purview integration.
14+
- Added `maxCumulativeIndexerRuntimeSeconds` property to `ServiceLimits` for runtime monitoring.
15+
- Added required `runtime` property to `SearchIndexerStatus` and `indexersRuntime` property to `ServiceStatistics`.
16+
- Added `product` enum value to `ScoringFunctionAggregation`.
17+
- Added enhanced knowledge source parameters: `sourceDataFields`, `searchFields`, `semanticConfigurationName` in `SearchIndexKnowledgeSourceParameters`.
18+
- Added Azure Data Lake Storage Gen2 support with `isADLSGen2` and `ingestionParameters` in `AzureBlobKnowledgeSourceParameters`.
19+
- Added partial content response support (HTTP 206) for knowledge base operations.
20+
- Added `error` property to `KnowledgeBaseActivityRecord` for enhanced error handling.
21+
- Added enhanced knowledge source parameters: `includeReferences`, `includeReferenceSourceData`, `alwaysQuerySource`, `rerankerThreshold` in `SearchIndexKnowledgeSourceParams`.
822

923
### Breaking Changes
1024

25+
- **Knowledge Agent to Knowledge Base Migration**: Complete API rename from Knowledge Agent to Knowledge Base.
26+
- All `KnowledgeAgent*` classes renamed to `KnowledgeBase*` (e.g., `KnowledgeAgent``KnowledgeBase`).
27+
- API paths changed from `/agents` to `/knowledgebases`.
28+
- Client parameter `AgentNameParameter` renamed to `KnowledgeBaseNameParameter`.
29+
- All agent-related activity record types updated with new naming convention
30+
- Removed deprecated Knowledge Agent classes: `KnowledgeAgentOutputConfiguration`, `KnowledgeAgentRequestLimits`, `KnowledgeAgentModel`, `KnowledgeAgentModelKind`, `KnowledgeAgentAzureOpenAIModel`.
31+
- Removed properties from `KnowledgeSourceReference`:`includeReferences`,`includeReferenceSourceData`,`alwaysQuerySource`,`maxSubQueries`,`rerankerThreshold`
32+
- Removed `sourceDataSelect` property from `SearchIndexKnowledgeSourceParameters`.
33+
- Removed properties from `AzureBlobKnowledgeSourceParameters`: `identity`, `embeddingModel`, `chatCompletionModel`, `ingestionSchedule`, `disableImageVerbalization`.
34+
1135
- Updated `RescoringOptions` to match what was changed in `11.8.0` release.
1236
- `isEnableRescoring` -> `isRescoringEnabled`
1337
- `setEnableRescoring` -> `setRescoringEnabled`
@@ -200,7 +224,7 @@ enabling multi-index grounding for agentic retrieval.
200224
- `QueryCaption` now supports a `maxCharLength` option to limit the character length of the caption.
201225
- `VectorizableTextQuery` now supports a `queryRewrites` option to specify the number query rewrites the service will generate.
202226
- `SemanticSearchOptions` now supports a `queryRewrites` option to specify the number query rewrites the service will generate.
203-
- `VectorSearchCompression` now supports configuring the `rescoringOptoins`.
227+
- `VectorSearchCompression` now supports configuring the `rescoringOptions`.
204228
- `IndexingParametersConfiguration` now supports two additional options for `MarkdownParsingSubmode` and `MarkdownHeaderDepth`.
205229
- Added a new skill: `DocumentIntelligenceLayoutSkill` that extracts content and layout information (as markdown), via Azure AI Services, from files within the enrichment pipeline.
206230
- Added 2 subtypes of `CognitiveServiceAccounts`: `AzureCognitiveServiceAccount` and `AzureCognitiveServiceAccountKey`.

sdk/search/azure-search-documents/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "java",
44
"TagPrefix": "java/search/azure-search-documents",
5-
"Tag": "java/search/azure-search-documents_b2580498bd"
5+
"Tag": "java/search/azure-search-documents_3eb1fda9ef"
66
}

sdk/search/azure-search-documents/checkstyle-suppressions.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- This file is generated by the /eng/scripts/linting_suppression_generator.py script. -->
44

55
<suppressions>
6+
<suppress files="com.azure.search.documents.knowledgebases.SearchKnowledgeBaseAsyncClient.java" checks="JavadocPackageCheck" />
67
<suppress files="com.azure.search.documents.test.environment.models.Book.java" checks="MemberNameCheck" />
78
<suppress files="com.azure.search.documents.test.environment.models.LoudHotel.java" checks="MemberNameCheck" />
89
<suppress files="com.azure.search.documents.test.environment.models.Book.java" checks="MethodNameCheck" />

sdk/search/azure-search-documents/spotbugs-exclude.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,18 @@
22

33
<FindBugsFilter xmlns="https://github.com/spotbugs/filter/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
5+
<Match>
6+
<Bug pattern="BC_VACUOUS_INSTANCEOF" />
7+
<Class name="com.azure.search.documents.KnowledgeSourceTests" />
8+
</Match>
9+
<Match>
10+
<Bug pattern="DCN_NULLPOINTER_EXCEPTION" />
11+
<Class name="com.azure.search.documents.KnowledgeSourceTests" />
12+
</Match>
513
<Match>
614
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
715
<Or>
16+
<Class name="com.azure.search.documents.KnowledgeSourceTests" />
817
<Class name="com.azure.search.documents.ReadmeSamples" />
918
<Class name="com.azure.search.documents.SearchJavaDocCodeSnippets" />
1019
</Or>
@@ -17,6 +26,17 @@
1726
<Class name="com.azure.search.documents.indexes.SearchIndexerClientBuilderTests" />
1827
</Or>
1928
</Match>
29+
<Match>
30+
<Bug pattern="DM_DEFAULT_ENCODING" />
31+
<Class name="com.azure.search.documents.KnowledgeSourceTests" />
32+
</Match>
33+
<Match>
34+
<Bug pattern="EC_UNRELATED_TYPES" />
35+
<Or>
36+
<Class name="com.azure.search.documents.KnowledgeSourceTests" />
37+
<Class name="com.azure.search.documents.indexes.SkillsetManagementTests" />
38+
</Or>
39+
</Match>
2040
<Match>
2141
<Bug pattern="EI_EXPOSE_STATIC_REP2" />
2242
<Or>
@@ -36,6 +56,10 @@
3656
<Class name="com.azure.search.documents.indexes.SearchIndexerClientBuilderTests" />
3757
</Or>
3858
</Match>
59+
<Match>
60+
<Bug pattern="UC_USELESS_OBJECT" />
61+
<Class name="com.azure.search.documents.indexes.SkillsetManagementTests" />
62+
</Match>
3963
<Match>
4064
<Bug pattern="UWF_UNWRITTEN_FIELD" />
4165
<Class name="com.azure.search.documents.test.environment.models.HotelWithUnsupportedField" />

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

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.azure.search.documents.implementation.util.Utility;
2929
import com.azure.search.documents.indexes.models.IndexDocumentsBatch;
3030
import com.azure.search.documents.models.AutocompleteOptions;
31+
import com.azure.search.documents.models.GetDocumentOptions;
3132
import com.azure.search.documents.models.IndexAction;
3233
import com.azure.search.documents.models.IndexActionType;
3334
import com.azure.search.documents.models.IndexBatchException;
@@ -55,6 +56,7 @@
5556

5657
import java.util.ArrayList;
5758
import java.util.List;
59+
import java.util.Objects;
5860
import java.util.function.Function;
5961
import java.util.stream.Collectors;
6062

@@ -858,7 +860,7 @@ Mono<Response<IndexDocumentsResult>> indexDocumentsWithResponse(IndexDocumentsBa
858860
*/
859861
@ServiceMethod(returns = ReturnType.SINGLE)
860862
public <T> Mono<T> getDocument(String key, Class<T> modelClass) {
861-
return getDocumentWithResponse(key, modelClass, null, null).map(Response::getValue);
863+
return getDocumentWithResponse(key, modelClass, (List<String>) null, (String) null).map(Response::getValue);
862864
}
863865

864866
/**
@@ -893,7 +895,8 @@ public <T> Mono<T> getDocument(String key, Class<T> modelClass) {
893895
*/
894896
@ServiceMethod(returns = ReturnType.SINGLE)
895897
public <T> Mono<T> getDocument(String key, Class<T> modelClass, String querySourceAuthorization) {
896-
return getDocumentWithResponse(key, modelClass, null, querySourceAuthorization).map(Response::getValue);
898+
return getDocumentWithResponse(key, modelClass, (List<String>) null, querySourceAuthorization)
899+
.map(Response::getValue);
897900
}
898901

899902
/**
@@ -929,7 +932,8 @@ public <T> Mono<T> getDocument(String key, Class<T> modelClass, String querySour
929932
*/
930933
@ServiceMethod(returns = ReturnType.SINGLE)
931934
public <T> Mono<Response<T>> getDocumentWithResponse(String key, Class<T> modelClass, List<String> selectedFields) {
932-
return withContext(context -> getDocumentWithResponse(key, modelClass, selectedFields, null, context));
935+
return withContext(
936+
context -> getDocumentWithResponseInternal(key, modelClass, selectedFields, null, null, context));
933937
}
934938

935939
/**
@@ -968,15 +972,44 @@ public <T> Mono<Response<T>> getDocumentWithResponse(String key, Class<T> modelC
968972
@ServiceMethod(returns = ReturnType.SINGLE)
969973
public <T> Mono<Response<T>> getDocumentWithResponse(String key, Class<T> modelClass, List<String> selectedFields,
970974
String querySourceAuthorization) {
971-
return withContext(
972-
context -> getDocumentWithResponse(key, modelClass, selectedFields, querySourceAuthorization, context));
975+
return withContext(context -> getDocumentWithResponseInternal(key, modelClass, selectedFields,
976+
querySourceAuthorization, null, context));
977+
}
978+
979+
/**
980+
* Retrieves a document from the Azure AI Search index.
981+
* <p>
982+
* View <a href="https://docs.microsoft.com/rest/api/searchservice/Naming-rules">naming rules</a> for guidelines on
983+
* constructing valid document keys.
984+
*
985+
* @param options Additional options for retrieving the document.
986+
* @param <T> Convert document to the generic type.
987+
* @return response containing a document object
988+
* @throws NullPointerException If {@code options} is null.
989+
* @see <a href="https://docs.microsoft.com/rest/api/searchservice/Lookup-Document">Lookup document</a>
990+
*/
991+
@ServiceMethod(returns = ReturnType.SINGLE)
992+
public <T> Mono<Response<T>> getDocumentWithResponse(GetDocumentOptions<T> options) {
993+
return withContext(context -> getDocumentWithResponse(options, context));
994+
}
995+
996+
<T> Mono<Response<T>> getDocumentWithResponse(GetDocumentOptions<T> options, Context context) {
997+
Objects.requireNonNull(options, "'options' cannot be null.");
998+
return getDocumentWithResponseInternal(options.getKey(), options.getModelClass(), options.getSelectedFields(),
999+
null, options.isElevatedReadEnabled(), context);
9731000
}
9741001

9751002
<T> Mono<Response<T>> getDocumentWithResponse(String key, Class<T> modelClass, List<String> selectedFields,
9761003
String querySourceAuthorization, Context context) {
1004+
return getDocumentWithResponseInternal(key, modelClass, selectedFields, querySourceAuthorization, null,
1005+
context);
1006+
}
1007+
1008+
<T> Mono<Response<T>> getDocumentWithResponseInternal(String key, Class<T> modelClass, List<String> selectedFields,
1009+
String querySourceAuthorization, Boolean enableElevatedRead, Context context) {
9771010
try {
9781011
return restClient.getDocuments()
979-
.getWithResponseAsync(key, selectedFields, querySourceAuthorization, null, context)
1012+
.getWithResponseAsync(key, selectedFields, querySourceAuthorization, enableElevatedRead, null, context)
9801013
.onErrorMap(Utility::exceptionMapper)
9811014
.map(res -> new SimpleResponse<>(res, serializer
9821015
.deserializeFromBytes(serializer.serializeToBytes(res.getValue()), createInstance(modelClass))));
@@ -1259,8 +1292,9 @@ public SearchPagedFlux search(String searchText, SearchOptions searchOptions, St
12591292
// The firstPageResponse shared among all functional calls below.
12601293
// Do not initial new instance directly in func call.
12611294
final SearchFirstPageResponseWrapper firstPageResponse = new SearchFirstPageResponseWrapper();
1262-
Function<String, Mono<SearchPagedResponse>> func = continuationToken -> withContext(
1263-
context -> search(request, continuationToken, firstPageResponse, querySourceAuthorization, context));
1295+
Boolean enableElevatedRead = (searchOptions != null) ? searchOptions.isElevatedReadEnabled() : null;
1296+
Function<String, Mono<SearchPagedResponse>> func = continuationToken -> withContext(context -> search(request,
1297+
continuationToken, firstPageResponse, querySourceAuthorization, enableElevatedRead, context));
12641298
return new SearchPagedFlux(() -> func.apply(null), func);
12651299
}
12661300

@@ -1269,20 +1303,22 @@ SearchPagedFlux search(String searchText, SearchOptions searchOptions, String qu
12691303
SearchRequest request = createSearchRequest(searchText, searchOptions);
12701304
// The firstPageResponse shared among all functional calls below.
12711305
// Do not initial new instance directly in func call.
1306+
Boolean enableElevatedRead = (searchOptions != null) ? searchOptions.isElevatedReadEnabled() : null;
12721307
final SearchFirstPageResponseWrapper firstPageResponseWrapper = new SearchFirstPageResponseWrapper();
12731308
Function<String, Mono<SearchPagedResponse>> func = continuationToken -> search(request, continuationToken,
1274-
firstPageResponseWrapper, querySourceAuthorization, context);
1309+
firstPageResponseWrapper, querySourceAuthorization, enableElevatedRead, context);
12751310
return new SearchPagedFlux(() -> func.apply(null), func);
12761311
}
12771312

12781313
private Mono<SearchPagedResponse> search(SearchRequest request, String continuationToken,
1279-
SearchFirstPageResponseWrapper firstPageResponseWrapper, String querySourceAuthorization, Context context) {
1314+
SearchFirstPageResponseWrapper firstPageResponseWrapper, String querySourceAuthorization,
1315+
Boolean enableElevatedRead, Context context) {
12801316
SearchRequest requestToUse = (continuationToken == null)
12811317
? request
12821318
: SearchContinuationToken.deserializeToken(serviceVersion.getVersion(), continuationToken);
12831319

12841320
return restClient.getDocuments()
1285-
.searchPostWithResponseAsync(requestToUse, querySourceAuthorization, null, context)
1321+
.searchPostWithResponseAsync(requestToUse, querySourceAuthorization, enableElevatedRead, null, context)
12861322
.onErrorMap(MappingUtils::exceptionMapper)
12871323
.map(response -> {
12881324
SearchPagedResponse page = mapToSearchPagedResponse(response, serializer, serviceVersion);

0 commit comments

Comments
 (0)