Skip to content

Commit

Permalink
Merge pull request #232 from weaviate/nested_objects_support
Browse files Browse the repository at this point in the history
Adds support for object/object[] data types
  • Loading branch information
aliszka authored Oct 3, 2023
2 parents 4406016 + 6f05b34 commit ddcba99
Show file tree
Hide file tree
Showing 14 changed files with 1,177 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public interface DataType {
String GEO_COORDINATES = "geoCoordinates";
String PHONE_NUMBER = "phoneNumber";
String UUID = "uuid";
String OBJECT = "object";

/**
* As of Weaviate v1.19 'string[]' is deprecated and replaced by 'text[]'.<br>
* See <a href="https://weaviate.io/developers/weaviate/config-refs/datatypes#introduction">data types</a>
Expand All @@ -28,4 +30,5 @@ public interface DataType {
String BOOLEAN_ARRAY = "boolean[]";
String DATE_ARRAY = "date[]";
String UUID_ARRAY = "uuid[]";
String OBJECT_ARRAY = "object[]";
}
17 changes: 17 additions & 0 deletions src/main/java/io/weaviate/client/v1/schema/model/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,21 @@ public class Property {
Boolean indexFilterable;
Boolean indexSearchable;
Object moduleConfig;
List<NestedProperty> nestedProperties;


@Getter
@Builder
@ToString
@EqualsAndHashCode
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
public static class NestedProperty {
String name;
List<String> dataType;
String description;
String tokenization;
Boolean indexFilterable;
Boolean indexSearchable;
List<NestedProperty> nestedProperties;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
public class WeaviateVersion {

// to be set according to weaviate docker image
public static final String EXPECTED_WEAVIATE_VERSION = "1.21.0";
public static final String EXPECTED_WEAVIATE_VERSION = "1.21.5";
// to be set according to weaviate docker image
public static final String EXPECTED_WEAVIATE_GIT_HASH = "8172acb";
public static final String EXPECTED_WEAVIATE_GIT_HASH = "8a40c6b";

private WeaviateVersion() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -448,179 +448,179 @@ public static Object[][] provideInvalidForDataTypeAndIndexing() {
new Object[]{
DataType.TEXT,
Boolean.FALSE, null, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.FALSE, null, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.FALSE, Boolean.FALSE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.FALSE, Boolean.FALSE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.FALSE, Boolean.FALSE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.FALSE, Boolean.TRUE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.FALSE, Boolean.TRUE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, null, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, null, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, Boolean.FALSE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, Boolean.FALSE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, Boolean.FALSE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, Boolean.TRUE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, Boolean.TRUE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.TEXT,
Boolean.TRUE, Boolean.TRUE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},

new Object[]{
DataType.INT,
Boolean.FALSE, null, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.FALSE, null, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.FALSE, Boolean.FALSE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.FALSE, Boolean.FALSE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.FALSE, Boolean.FALSE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.FALSE, Boolean.TRUE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.FALSE, Boolean.TRUE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, null, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, null, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, Boolean.FALSE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, Boolean.FALSE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, Boolean.FALSE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, Boolean.TRUE, null,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, Boolean.TRUE, Boolean.FALSE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},
new Object[]{
DataType.INT,
Boolean.TRUE, Boolean.TRUE, Boolean.TRUE,
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
},

new Object[]{
DataType.INT,
null, null, Boolean.TRUE,
"`indexSearchable` is allowed only for text/text[] data types. For other data types set false or leave empty",
"`indexSearchable` is not allowed for other than text/text[] data types",
},
new Object[]{
DataType.INT,
null, Boolean.FALSE, Boolean.TRUE,
"`indexSearchable` is allowed only for text/text[] data types. For other data types set false or leave empty",
"`indexSearchable` is not allowed for other than text/text[] data types",
},
new Object[]{
DataType.INT,
null, Boolean.TRUE, Boolean.TRUE,
"`indexSearchable` is allowed only for text/text[] data types. For other data types set false or leave empty",
"`indexSearchable` is not allowed for other than text/text[] data types",
},
};
}
Expand Down
Loading

0 comments on commit ddcba99

Please sign in to comment.