Skip to content

Commit 070443e

Browse files
authored
Change azure-search-documents back to targeting preview version (Azure#37643)
Change azure-search-documents back to targeting preview version
1 parent a408230 commit 070443e

File tree

113 files changed

+10113
-571
lines changed

Some content is hidden

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

113 files changed

+10113
-571
lines changed

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_317051cb04"
5+
"Tag": "java/search/azure-search-documents_00e51e1a6d"
66
}

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,9 @@ static SearchRequest createSearchRequest(String searchText, SearchOptions option
10971097
.setSessionId(options.getSessionId())
10981098
.setSelect(nullSafeStringJoin(options.getSelect()))
10991099
.setSkip(options.getSkip())
1100-
.setTop(options.getTop());
1100+
.setTop(options.getTop())
1101+
.setQueryLanguage(options.getQueryLanguage())
1102+
.setSpeller(options.getSpeller());
11011103

11021104
SemanticSearchOptions semanticSearchOptions = options.getSemanticSearchOptions();
11031105
if (semanticSearchOptions != null) {
@@ -1107,7 +1109,10 @@ static SearchRequest createSearchRequest(String searchText, SearchOptions option
11071109
.setSemanticErrorHandling(semanticSearchOptions.getErrorMode())
11081110
.setSemanticMaxWaitInMilliseconds(waitInMillis)
11091111
.setAnswers(createSearchRequestAnswers(semanticSearchOptions.getQueryAnswer()))
1110-
.setCaptions(createSearchRequestCaptions(semanticSearchOptions.getQueryCaption()));
1112+
.setCaptions(createSearchRequestCaptions(semanticSearchOptions.getQueryCaption()))
1113+
.setSemanticQuery(semanticSearchOptions.getSemanticQuery())
1114+
.setSemanticFields(nullSafeStringJoin(semanticSearchOptions.getSemanticFields()))
1115+
.setDebug(semanticSearchOptions.getDebug());
11111116
}
11121117

11131118
VectorSearchOptions vectorSearchOptions = options.getVectorSearchOptions();

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ public enum SearchServiceVersion implements ServiceVersion {
1717
/**
1818
* {@code 2023-11-01} service version.
1919
*/
20-
V2023_11_01("2023-11-01");
20+
V2023_11_01("2023-11-01"),
21+
22+
/**
23+
* {@code 2023-10-01-preview} service version.
24+
*/
25+
V2023_10_01_PREVIEW("2023-10-01-preview");
2126

2227
private final String version;
2328

@@ -39,6 +44,6 @@ public String getVersion() {
3944
* @return The latest version supported by this client library.
4045
*/
4146
public static SearchServiceVersion getLatest() {
42-
return V2023_11_01;
47+
return V2023_10_01_PREVIEW;
4348
}
4449
}

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

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
import com.azure.search.documents.models.AutocompleteMode;
3434
import com.azure.search.documents.models.AutocompleteResult;
3535
import com.azure.search.documents.models.IndexDocumentsResult;
36+
import com.azure.search.documents.models.QueryDebugMode;
37+
import com.azure.search.documents.models.QueryLanguage;
38+
import com.azure.search.documents.models.QuerySpellerType;
3639
import com.azure.search.documents.models.QueryType;
3740
import com.azure.search.documents.models.ScoringStatistics;
3841
import com.azure.search.documents.models.SearchMode;
@@ -112,20 +115,25 @@ Mono<Response<SearchDocumentsResult>> searchGet(
112115
@QueryParam("queryType") QueryType queryType,
113116
@QueryParam(value = "scoringParameter", multipleQueryParams = true) List<String> scoringParameters,
114117
@QueryParam("scoringProfile") String scoringProfile,
118+
@QueryParam("semanticQuery") String semanticQuery,
119+
@QueryParam("semanticConfiguration") String semanticConfiguration,
120+
@QueryParam("semanticErrorHandling") SemanticErrorMode semanticErrorHandling,
121+
@QueryParam("semanticMaxWaitInMilliseconds") Integer semanticMaxWaitInMilliseconds,
122+
@QueryParam("debug") QueryDebugMode debug,
115123
@QueryParam("searchFields") String searchFields,
124+
@QueryParam("queryLanguage") QueryLanguage queryLanguage,
125+
@QueryParam("speller") QuerySpellerType speller,
126+
@QueryParam("answers") String answers,
116127
@QueryParam("searchMode") SearchMode searchMode,
117128
@QueryParam("scoringStatistics") ScoringStatistics scoringStatistics,
118129
@QueryParam("sessionId") String sessionId,
119130
@QueryParam("$select") String select,
120131
@QueryParam("$skip") Integer skip,
121132
@QueryParam("$top") Integer top,
133+
@QueryParam("captions") String captions,
134+
@QueryParam("semanticFields") String semanticFields,
122135
@QueryParam("api-version") String apiVersion,
123136
@HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
124-
@QueryParam("semanticConfiguration") String semanticConfiguration,
125-
@QueryParam("semanticErrorHandling") SemanticErrorMode semanticErrorHandling,
126-
@QueryParam("semanticMaxWaitInMilliseconds") Integer semanticMaxWaitInMilliseconds,
127-
@QueryParam("answers") String answers,
128-
@QueryParam("captions") String captions,
129137
@HeaderParam("Accept") String accept,
130138
Context context);
131139

@@ -147,20 +155,25 @@ Response<SearchDocumentsResult> searchGetSync(
147155
@QueryParam("queryType") QueryType queryType,
148156
@QueryParam(value = "scoringParameter", multipleQueryParams = true) List<String> scoringParameters,
149157
@QueryParam("scoringProfile") String scoringProfile,
158+
@QueryParam("semanticQuery") String semanticQuery,
159+
@QueryParam("semanticConfiguration") String semanticConfiguration,
160+
@QueryParam("semanticErrorHandling") SemanticErrorMode semanticErrorHandling,
161+
@QueryParam("semanticMaxWaitInMilliseconds") Integer semanticMaxWaitInMilliseconds,
162+
@QueryParam("debug") QueryDebugMode debug,
150163
@QueryParam("searchFields") String searchFields,
164+
@QueryParam("queryLanguage") QueryLanguage queryLanguage,
165+
@QueryParam("speller") QuerySpellerType speller,
166+
@QueryParam("answers") String answers,
151167
@QueryParam("searchMode") SearchMode searchMode,
152168
@QueryParam("scoringStatistics") ScoringStatistics scoringStatistics,
153169
@QueryParam("sessionId") String sessionId,
154170
@QueryParam("$select") String select,
155171
@QueryParam("$skip") Integer skip,
156172
@QueryParam("$top") Integer top,
173+
@QueryParam("captions") String captions,
174+
@QueryParam("semanticFields") String semanticFields,
157175
@QueryParam("api-version") String apiVersion,
158176
@HeaderParam("x-ms-client-request-id") UUID xMsClientRequestId,
159-
@QueryParam("semanticConfiguration") String semanticConfiguration,
160-
@QueryParam("semanticErrorHandling") SemanticErrorMode semanticErrorHandling,
161-
@QueryParam("semanticMaxWaitInMilliseconds") Integer semanticMaxWaitInMilliseconds,
162-
@QueryParam("answers") String answers,
163-
@QueryParam("captions") String captions,
164177
@HeaderParam("Accept") String accept,
165178
Context context);
166179

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ public static SearchResult map(com.azure.search.documents.implementation.models.
2222
}
2323

2424
SearchResult searchResult = new SearchResult(obj.getScore());
25-
25+
2626
SearchResultHelper.setHighlights(searchResult, obj.getHighlights());
27-
SearchResultHelper.setSemanticSearchResults(searchResult, obj.getRerankerScore(), obj.getCaptions());
27+
SearchResultHelper.setSemanticSearchResults(searchResult, obj.getRerankerScore(), obj.getCaptions(),
28+
obj.getDocumentDebugInfo());
2829
SearchResultHelper.setAdditionalProperties(searchResult, new SearchDocument(obj.getAdditionalProperties()));
2930
SearchResultHelper.setJsonSerializer(searchResult, (JsonSerializer) serializer);
3031
return searchResult;

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import com.azure.core.util.serializer.JsonSerializer;
77
import com.azure.search.documents.SearchDocument;
8+
import com.azure.search.documents.models.DocumentDebugInfo;
89
import com.azure.search.documents.models.QueryCaptionResult;
910
import com.azure.search.documents.models.SearchResult;
1011

@@ -27,7 +28,7 @@ public interface SearchResultAccessor {
2728
void setHighlights(SearchResult searchResult, Map<String, List<String>> highlights);
2829
void setJsonSerializer(SearchResult searchResult, JsonSerializer jsonSerializer);
2930
void setSemanticSearchResults(SearchResult searchResult, Double rerankerScore,
30-
List<QueryCaptionResult> captions);
31+
List<QueryCaptionResult> captions, List<DocumentDebugInfo> debugInfo);
3132
}
3233

3334
/**
@@ -52,7 +53,7 @@ static void setJsonSerializer(SearchResult searchResult, JsonSerializer jsonSeri
5253
}
5354

5455
static void setSemanticSearchResults(SearchResult searchResult, Double rerankerScore,
55-
List<QueryCaptionResult> captions) {
56-
accessor.setSemanticSearchResults(searchResult, rerankerScore, captions);
56+
List<QueryCaptionResult> captions, List<DocumentDebugInfo> debugInfo) {
57+
accessor.setSemanticSearchResults(searchResult, rerankerScore, captions, debugInfo);
5758
}
5859
}

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

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,26 @@ public final class SearchDocumentsResult implements JsonSerializable<SearchDocum
5656
private SearchRequest nextPageParameters;
5757

5858
/*
59-
* The sequence of results returned by the query.
59+
* Reason that a partial response was returned for a semantic ranking request.
6060
*/
61-
private final List<SearchResult> results;
61+
private SemanticErrorReason semanticPartialResponseReason;
6262

6363
/*
64-
* Continuation URL returned when the query can't return all the requested results in a single response. You can
65-
* use this URL to formulate another GET or POST Search request to get the next part of the search response. Make
66-
* sure to use the same verb (GET or POST) as the request that produced this response.
64+
* Type of partial response that was returned for a semantic ranking request.
6765
*/
68-
private String nextLink;
66+
private SemanticSearchResultsType semanticPartialResponseType;
6967

7068
/*
71-
* Reason that a partial response was returned for a semantic ranking request.
69+
* The sequence of results returned by the query.
7270
*/
73-
private SemanticErrorReason semanticPartialResponseReason;
71+
private final List<SearchResult> results;
7472

7573
/*
76-
* Type of partial response that was returned for a semantic ranking request.
74+
* Continuation URL returned when the query can't return all the requested results in a single response. You can
75+
* use this URL to formulate another GET or POST Search request to get the next part of the search response. Make
76+
* sure to use the same verb (GET or POST) as the request that produced this response.
7777
*/
78-
private SemanticSearchResultsType semanticPartialResponseType;
78+
private String nextLink;
7979

8080
/**
8181
* Creates an instance of SearchDocumentsResult class.
@@ -139,26 +139,6 @@ public SearchRequest getNextPageParameters() {
139139
return this.nextPageParameters;
140140
}
141141

142-
/**
143-
* Get the results property: The sequence of results returned by the query.
144-
*
145-
* @return the results value.
146-
*/
147-
public List<SearchResult> getResults() {
148-
return this.results;
149-
}
150-
151-
/**
152-
* Get the nextLink property: Continuation URL returned when the query can't return all the requested results in a
153-
* single response. You can use this URL to formulate another GET or POST Search request to get the next part of the
154-
* search response. Make sure to use the same verb (GET or POST) as the request that produced this response.
155-
*
156-
* @return the nextLink value.
157-
*/
158-
public String getNextLink() {
159-
return this.nextLink;
160-
}
161-
162142
/**
163143
* Get the semanticPartialResponseReason property: Reason that a partial response was returned for a semantic
164144
* ranking request.
@@ -179,6 +159,26 @@ public SemanticSearchResultsType getSemanticPartialResponseType() {
179159
return this.semanticPartialResponseType;
180160
}
181161

162+
/**
163+
* Get the results property: The sequence of results returned by the query.
164+
*
165+
* @return the results value.
166+
*/
167+
public List<SearchResult> getResults() {
168+
return this.results;
169+
}
170+
171+
/**
172+
* Get the nextLink property: Continuation URL returned when the query can't return all the requested results in a
173+
* single response. You can use this URL to formulate another GET or POST Search request to get the next part of the
174+
* search response. Make sure to use the same verb (GET or POST) as the request that produced this response.
175+
*
176+
* @return the nextLink value.
177+
*/
178+
public String getNextLink() {
179+
return this.nextLink;
180+
}
181+
182182
@Override
183183
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
184184
jsonWriter.writeStartObject();
@@ -204,9 +204,9 @@ public static SearchDocumentsResult fromJson(JsonReader jsonReader) throws IOExc
204204
Map<String, List<FacetResult>> facets = null;
205205
List<QueryAnswerResult> answers = null;
206206
SearchRequest nextPageParameters = null;
207-
String nextLink = null;
208207
SemanticErrorReason semanticPartialResponseReason = null;
209208
SemanticSearchResultsType semanticPartialResponseType = null;
209+
String nextLink = null;
210210
while (reader.nextToken() != JsonToken.END_OBJECT) {
211211
String fieldName = reader.getFieldName();
212212
reader.nextToken();
@@ -226,12 +226,12 @@ public static SearchDocumentsResult fromJson(JsonReader jsonReader) throws IOExc
226226
answers = reader.readArray(reader1 -> QueryAnswerResult.fromJson(reader1));
227227
} else if ("@search.nextPageParameters".equals(fieldName)) {
228228
nextPageParameters = SearchRequest.fromJson(reader);
229-
} else if ("@odata.nextLink".equals(fieldName)) {
230-
nextLink = reader.getString();
231229
} else if ("@search.semanticPartialResponseReason".equals(fieldName)) {
232230
semanticPartialResponseReason = SemanticErrorReason.fromString(reader.getString());
233231
} else if ("@search.semanticPartialResponseType".equals(fieldName)) {
234232
semanticPartialResponseType = SemanticSearchResultsType.fromString(reader.getString());
233+
} else if ("@odata.nextLink".equals(fieldName)) {
234+
nextLink = reader.getString();
235235
} else {
236236
reader.skipChildren();
237237
}
@@ -243,9 +243,9 @@ public static SearchDocumentsResult fromJson(JsonReader jsonReader) throws IOExc
243243
deserializedSearchDocumentsResult.facets = facets;
244244
deserializedSearchDocumentsResult.answers = answers;
245245
deserializedSearchDocumentsResult.nextPageParameters = nextPageParameters;
246-
deserializedSearchDocumentsResult.nextLink = nextLink;
247246
deserializedSearchDocumentsResult.semanticPartialResponseReason = semanticPartialResponseReason;
248247
deserializedSearchDocumentsResult.semanticPartialResponseType = semanticPartialResponseType;
248+
deserializedSearchDocumentsResult.nextLink = nextLink;
249249

250250
return deserializedSearchDocumentsResult;
251251
}

0 commit comments

Comments
 (0)