Skip to content

Commit 376955f

Browse files
Search May Preview Regen Updates (Azure#40057)
* Search May Preview Regeneration - Still need to add varargs convenience * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * Removing ovveride statements from `setFields` for `VectorizableImageUrlQuery` and `VectorizableImageBinaryQuery` * adding varargs * Additional adjustments to FieldBuilder and Search Index Customizations * Updating cspell.json * Adjust `SearchScoreThreshold` customization Re-enable code generation in CI * Updates: - Updated Cspell - Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in SearchServiceLimits - Set `hybridSearch` property to be type `HybridSearch` in SearchRequest - Add `hybridSearch` to SearchOptions and `SearchAsyncClient.createSearchRequest()` * Adding Support and testing byte[] and List<byte> within field builder * Fix linting --------- Co-authored-by: alzimmermsft <[email protected]>
1 parent 847a8ae commit 376955f

File tree

4 files changed

+32
-15
lines changed

4 files changed

+32
-15
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public final class FieldBuilder {
5454
private static final int MAX_DEPTH = 10000;
5555
private static final Map<Type, SearchFieldDataType> SUPPORTED_NONE_PARAMETERIZED_TYPE = new HashMap<>();
5656
private static final Set<Type> UNSUPPORTED_TYPES = new HashSet<>();
57+
private static final Set<SearchFieldDataType> UNSUPPORTED_SERVICE_TYPES = new HashSet<>();
5758

5859
private static final SearchFieldDataType COLLECTION_STRING
5960
= SearchFieldDataType.collection(SearchFieldDataType.STRING);
@@ -83,6 +84,7 @@ public final class FieldBuilder {
8384
SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Byte.class, SearchFieldDataType.SBYTE);
8485
SUPPORTED_NONE_PARAMETERIZED_TYPE.put(short.class, SearchFieldDataType.INT16);
8586
SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Short.class, SearchFieldDataType.INT16);
87+
UNSUPPORTED_SERVICE_TYPES.add(SearchFieldDataType.BYTE);
8688
}
8789

8890
/**

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public SearchServiceLimits() {
5252

5353
/**
5454
* Get the maxFieldsPerIndex property: The maximum allowed fields per index.
55-
*
55+
*
5656
* @return the maxFieldsPerIndex value.
5757
*/
5858
public Integer getMaxFieldsPerIndex() {
@@ -61,7 +61,7 @@ public Integer getMaxFieldsPerIndex() {
6161

6262
/**
6363
* Set the maxFieldsPerIndex property: The maximum allowed fields per index.
64-
*
64+
*
6565
* @param maxFieldsPerIndex the maxFieldsPerIndex value to set.
6666
* @return the SearchServiceLimits object itself.
6767
*/
@@ -73,7 +73,7 @@ public SearchServiceLimits setMaxFieldsPerIndex(Integer maxFieldsPerIndex) {
7373
/**
7474
* Get the maxFieldNestingDepthPerIndex property: The maximum depth which you can nest sub-fields in an index,
7575
* including the top-level complex field. For example, a/b/c has a nesting depth of 3.
76-
*
76+
*
7777
* @return the maxFieldNestingDepthPerIndex value.
7878
*/
7979
public Integer getMaxFieldNestingDepthPerIndex() {
@@ -83,7 +83,7 @@ public Integer getMaxFieldNestingDepthPerIndex() {
8383
/**
8484
* Set the maxFieldNestingDepthPerIndex property: The maximum depth which you can nest sub-fields in an index,
8585
* including the top-level complex field. For example, a/b/c has a nesting depth of 3.
86-
*
86+
*
8787
* @param maxFieldNestingDepthPerIndex the maxFieldNestingDepthPerIndex value to set.
8888
* @return the SearchServiceLimits object itself.
8989
*/
@@ -95,7 +95,7 @@ public SearchServiceLimits setMaxFieldNestingDepthPerIndex(Integer maxFieldNesti
9595
/**
9696
* Get the maxComplexCollectionFieldsPerIndex property: The maximum number of fields of type
9797
* Collection(Edm.ComplexType) allowed in an index.
98-
*
98+
*
9999
* @return the maxComplexCollectionFieldsPerIndex value.
100100
*/
101101
public Integer getMaxComplexCollectionFieldsPerIndex() {
@@ -105,7 +105,7 @@ public Integer getMaxComplexCollectionFieldsPerIndex() {
105105
/**
106106
* Set the maxComplexCollectionFieldsPerIndex property: The maximum number of fields of type
107107
* Collection(Edm.ComplexType) allowed in an index.
108-
*
108+
*
109109
* @param maxComplexCollectionFieldsPerIndex the maxComplexCollectionFieldsPerIndex value to set.
110110
* @return the SearchServiceLimits object itself.
111111
*/
@@ -117,7 +117,7 @@ public SearchServiceLimits setMaxComplexCollectionFieldsPerIndex(Integer maxComp
117117
/**
118118
* Get the maxComplexObjectsInCollectionsPerDocument property: The maximum number of objects in complex collections
119119
* allowed per document.
120-
*
120+
*
121121
* @return the maxComplexObjectsInCollectionsPerDocument value.
122122
*/
123123
public Integer getMaxComplexObjectsInCollectionsPerDocument() {
@@ -127,7 +127,7 @@ public Integer getMaxComplexObjectsInCollectionsPerDocument() {
127127
/**
128128
* Set the maxComplexObjectsInCollectionsPerDocument property: The maximum number of objects in complex collections
129129
* allowed per document.
130-
*
130+
*
131131
* @param maxComplexObjectsInCollectionsPerDocument the maxComplexObjectsInCollectionsPerDocument value to set.
132132
* @return the SearchServiceLimits object itself.
133133
*/
@@ -139,7 +139,7 @@ public Integer getMaxComplexObjectsInCollectionsPerDocument() {
139139

140140
/**
141141
* Get the maxStoragePerIndexInBytes property: The maximum amount of storage in bytes allowed per index.
142-
*
142+
*
143143
* @return the maxStoragePerIndexInBytes value.
144144
*/
145145
public Long getMaxStoragePerIndexInBytes() {
@@ -148,7 +148,7 @@ public Long getMaxStoragePerIndexInBytes() {
148148

149149
/**
150150
* Set the maxStoragePerIndexInBytes property: The maximum amount of storage in bytes allowed per index.
151-
*
151+
*
152152
* @param maxStoragePerIndexInBytes the maxStoragePerIndexInBytes value to set.
153153
* @return the SearchServiceLimits object itself.
154154
*/
@@ -171,7 +171,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
171171

172172
/**
173173
* Reads an instance of SearchServiceLimits from the JsonReader.
174-
*
174+
*
175175
* @param jsonReader The JsonReader being read.
176176
* @return An instance of SearchServiceLimits if the JsonReader was pointing to an instance of it, or null if it was
177177
* pointing to JSON null.

sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class VectorSearchVectorizer implements JsonSerializable<VectorSearchVect
2525

2626
/**
2727
* Creates an instance of VectorSearchVectorizer class.
28-
*
28+
*
2929
* @param name the name value to set.
3030
*/
3131
public VectorSearchVectorizer(String name) {
@@ -34,7 +34,7 @@ public VectorSearchVectorizer(String name) {
3434

3535
/**
3636
* Get the name property: The name to associate with this particular vectorization method.
37-
*
37+
*
3838
* @return the name value.
3939
*/
4040
public String getName() {
@@ -50,7 +50,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
5050

5151
/**
5252
* Reads an instance of VectorSearchVectorizer from the JsonReader.
53-
*
53+
*
5454
* @param jsonReader The JsonReader being read.
5555
* @return An instance of VectorSearchVectorizer if the JsonReader was pointing to an instance of it, or null if it
5656
* was pointing to JSON null.

sdk/search/azure-search-documents/src/test/java/com/azure/search/documents/indexes/FieldBuilderTests.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public void ignoredPropertyName() {
126126
public void supportedFields() {
127127
List<SearchField> fields = SearchIndexClient.buildSearchFields(AllSupportedFields.class, null);
128128

129-
assertEquals(23, fields.size());
129+
assertEquals(25, fields.size());
130130

131131
Map<String, SearchFieldDataType> fieldToDataType = fields.stream()
132132
.collect(Collectors.toMap(SearchField::getName, SearchField::getType));
@@ -154,6 +154,9 @@ public void supportedFields() {
154154
assertEquals(SearchFieldDataType.INT16, fieldToDataType.get("primitiveShort"));
155155
assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("nullableByte"));
156156
assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("primitiveByte"));
157+
assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SBYTE), fieldToDataType.get("byteArray"));
158+
assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SBYTE), fieldToDataType.get("byteList"));
159+
157160
}
158161

159162
@SuppressWarnings({"unused", "UseOfObsoleteDateTimeApi"})
@@ -296,6 +299,18 @@ public byte getPrimitiveByte() {
296299
public Byte getNullableByte() {
297300
return nullableByte;
298301
}
302+
303+
// 24. name = 'byteArray', OData type = COMPLEX
304+
private byte[] byteArray;
305+
public byte[] getByteArray() {
306+
return byteArray;
307+
}
308+
309+
// 25. name = 'byteList', OData type = COMPLEX
310+
private List<Byte> byteList;
311+
public List<Byte> getByteList() {
312+
return byteList;
313+
}
299314
}
300315
@Test
301316
public void validNormalizerField() {

0 commit comments

Comments
 (0)