diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java index 47680fb5bf86..27b62030f428 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/implementation/util/FieldBuilder.java @@ -54,6 +54,7 @@ public final class FieldBuilder { private static final int MAX_DEPTH = 10000; private static final Map SUPPORTED_NONE_PARAMETERIZED_TYPE = new HashMap<>(); private static final Set UNSUPPORTED_TYPES = new HashSet<>(); + private static final Set UNSUPPORTED_SERVICE_TYPES = new HashSet<>(); private static final SearchFieldDataType COLLECTION_STRING = SearchFieldDataType.collection(SearchFieldDataType.STRING); @@ -83,6 +84,7 @@ public final class FieldBuilder { SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Byte.class, SearchFieldDataType.SBYTE); SUPPORTED_NONE_PARAMETERIZED_TYPE.put(short.class, SearchFieldDataType.INT16); SUPPORTED_NONE_PARAMETERIZED_TYPE.put(Short.class, SearchFieldDataType.INT16); + UNSUPPORTED_SERVICE_TYPES.add(SearchFieldDataType.BYTE); } /** diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java index 56ed0ebb3253..dd77354f1469 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/SearchServiceLimits.java @@ -52,7 +52,7 @@ public SearchServiceLimits() { /** * Get the maxFieldsPerIndex property: The maximum allowed fields per index. - * + * * @return the maxFieldsPerIndex value. */ public Integer getMaxFieldsPerIndex() { @@ -61,7 +61,7 @@ public Integer getMaxFieldsPerIndex() { /** * Set the maxFieldsPerIndex property: The maximum allowed fields per index. - * + * * @param maxFieldsPerIndex the maxFieldsPerIndex value to set. * @return the SearchServiceLimits object itself. */ @@ -73,7 +73,7 @@ public SearchServiceLimits setMaxFieldsPerIndex(Integer maxFieldsPerIndex) { /** * Get the maxFieldNestingDepthPerIndex property: The maximum depth which you can nest sub-fields in an index, * including the top-level complex field. For example, a/b/c has a nesting depth of 3. - * + * * @return the maxFieldNestingDepthPerIndex value. */ public Integer getMaxFieldNestingDepthPerIndex() { @@ -83,7 +83,7 @@ public Integer getMaxFieldNestingDepthPerIndex() { /** * Set the maxFieldNestingDepthPerIndex property: The maximum depth which you can nest sub-fields in an index, * including the top-level complex field. For example, a/b/c has a nesting depth of 3. - * + * * @param maxFieldNestingDepthPerIndex the maxFieldNestingDepthPerIndex value to set. * @return the SearchServiceLimits object itself. */ @@ -95,7 +95,7 @@ public SearchServiceLimits setMaxFieldNestingDepthPerIndex(Integer maxFieldNesti /** * Get the maxComplexCollectionFieldsPerIndex property: The maximum number of fields of type * Collection(Edm.ComplexType) allowed in an index. - * + * * @return the maxComplexCollectionFieldsPerIndex value. */ public Integer getMaxComplexCollectionFieldsPerIndex() { @@ -105,7 +105,7 @@ public Integer getMaxComplexCollectionFieldsPerIndex() { /** * Set the maxComplexCollectionFieldsPerIndex property: The maximum number of fields of type * Collection(Edm.ComplexType) allowed in an index. - * + * * @param maxComplexCollectionFieldsPerIndex the maxComplexCollectionFieldsPerIndex value to set. * @return the SearchServiceLimits object itself. */ @@ -117,7 +117,7 @@ public SearchServiceLimits setMaxComplexCollectionFieldsPerIndex(Integer maxComp /** * Get the maxComplexObjectsInCollectionsPerDocument property: The maximum number of objects in complex collections * allowed per document. - * + * * @return the maxComplexObjectsInCollectionsPerDocument value. */ public Integer getMaxComplexObjectsInCollectionsPerDocument() { @@ -127,7 +127,7 @@ public Integer getMaxComplexObjectsInCollectionsPerDocument() { /** * Set the maxComplexObjectsInCollectionsPerDocument property: The maximum number of objects in complex collections * allowed per document. - * + * * @param maxComplexObjectsInCollectionsPerDocument the maxComplexObjectsInCollectionsPerDocument value to set. * @return the SearchServiceLimits object itself. */ @@ -139,7 +139,7 @@ public Integer getMaxComplexObjectsInCollectionsPerDocument() { /** * Get the maxStoragePerIndexInBytes property: The maximum amount of storage in bytes allowed per index. - * + * * @return the maxStoragePerIndexInBytes value. */ public Long getMaxStoragePerIndexInBytes() { @@ -148,7 +148,7 @@ public Long getMaxStoragePerIndexInBytes() { /** * Set the maxStoragePerIndexInBytes property: The maximum amount of storage in bytes allowed per index. - * + * * @param maxStoragePerIndexInBytes the maxStoragePerIndexInBytes value to set. * @return the SearchServiceLimits object itself. */ @@ -171,7 +171,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { /** * Reads an instance of SearchServiceLimits from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of SearchServiceLimits if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. diff --git a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java index eda331029689..a7b7fd0717e3 100644 --- a/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java +++ b/sdk/search/azure-search-documents/src/main/java/com/azure/search/documents/indexes/models/VectorSearchVectorizer.java @@ -25,7 +25,7 @@ public class VectorSearchVectorizer implements JsonSerializable fields = SearchIndexClient.buildSearchFields(AllSupportedFields.class, null); - assertEquals(23, fields.size()); + assertEquals(25, fields.size()); Map fieldToDataType = fields.stream() .collect(Collectors.toMap(SearchField::getName, SearchField::getType)); @@ -154,6 +154,9 @@ public void supportedFields() { assertEquals(SearchFieldDataType.INT16, fieldToDataType.get("primitiveShort")); assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("nullableByte")); assertEquals(SearchFieldDataType.SBYTE, fieldToDataType.get("primitiveByte")); + assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SBYTE), fieldToDataType.get("byteArray")); + assertEquals(SearchFieldDataType.collection(SearchFieldDataType.SBYTE), fieldToDataType.get("byteList")); + } @SuppressWarnings({"unused", "UseOfObsoleteDateTimeApi"}) @@ -296,6 +299,18 @@ public byte getPrimitiveByte() { public Byte getNullableByte() { return nullableByte; } + + // 24. name = 'byteArray', OData type = COMPLEX + private byte[] byteArray; + public byte[] getByteArray() { + return byteArray; + } + + // 25. name = 'byteList', OData type = COMPLEX + private List byteList; + public List getByteList() { + return byteList; + } } @Test public void validNormalizerField() {