Skip to content

Commit 6f05b34

Browse files
committed
adds support for object/object[] data types
1 parent 4406016 commit 6f05b34

14 files changed

+1177
-58
lines changed

src/main/java/io/weaviate/client/v1/schema/model/DataType.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ public interface DataType {
1616
String GEO_COORDINATES = "geoCoordinates";
1717
String PHONE_NUMBER = "phoneNumber";
1818
String UUID = "uuid";
19+
String OBJECT = "object";
20+
1921
/**
2022
* As of Weaviate v1.19 'string[]' is deprecated and replaced by 'text[]'.<br>
2123
* See <a href="https://weaviate.io/developers/weaviate/config-refs/datatypes#introduction">data types</a>
@@ -28,4 +30,5 @@ public interface DataType {
2830
String BOOLEAN_ARRAY = "boolean[]";
2931
String DATE_ARRAY = "date[]";
3032
String UUID_ARRAY = "uuid[]";
33+
String OBJECT_ARRAY = "object[]";
3134
}

src/main/java/io/weaviate/client/v1/schema/model/Property.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,21 @@ public class Property {
2828
Boolean indexFilterable;
2929
Boolean indexSearchable;
3030
Object moduleConfig;
31+
List<NestedProperty> nestedProperties;
32+
33+
34+
@Getter
35+
@Builder
36+
@ToString
37+
@EqualsAndHashCode
38+
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
39+
public static class NestedProperty {
40+
String name;
41+
List<String> dataType;
42+
String description;
43+
String tokenization;
44+
Boolean indexFilterable;
45+
Boolean indexSearchable;
46+
List<NestedProperty> nestedProperties;
47+
}
3148
}

src/test/java/io/weaviate/integration/client/WeaviateVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
public class WeaviateVersion {
44

55
// to be set according to weaviate docker image
6-
public static final String EXPECTED_WEAVIATE_VERSION = "1.21.0";
6+
public static final String EXPECTED_WEAVIATE_VERSION = "1.21.5";
77
// to be set according to weaviate docker image
8-
public static final String EXPECTED_WEAVIATE_GIT_HASH = "8172acb";
8+
public static final String EXPECTED_WEAVIATE_GIT_HASH = "8a40c6b";
99

1010
private WeaviateVersion() {}
1111
}

src/test/java/io/weaviate/integration/client/schema/ClientSchemaDefaultsAndMigrationTest.java

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -448,179 +448,179 @@ public static Object[][] provideInvalidForDataTypeAndIndexing() {
448448
new Object[]{
449449
DataType.TEXT,
450450
Boolean.FALSE, null, Boolean.FALSE,
451-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
451+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
452452
},
453453
new Object[]{
454454
DataType.TEXT,
455455
Boolean.FALSE, null, Boolean.TRUE,
456-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
456+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
457457
},
458458
new Object[]{
459459
DataType.TEXT,
460460
Boolean.FALSE, Boolean.FALSE, null,
461-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
461+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
462462
},
463463
new Object[]{
464464
DataType.TEXT,
465465
Boolean.FALSE, Boolean.FALSE, Boolean.FALSE,
466-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
466+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
467467
},
468468
new Object[]{
469469
DataType.TEXT,
470470
Boolean.FALSE, Boolean.FALSE, Boolean.TRUE,
471-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
471+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
472472
},
473473
new Object[]{
474474
DataType.TEXT,
475475
Boolean.FALSE, Boolean.TRUE, null,
476-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
476+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
477477
},
478478
new Object[]{
479479
DataType.TEXT,
480480
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE,
481-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
481+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
482482
},
483483
new Object[]{
484484
DataType.TEXT,
485485
Boolean.FALSE, Boolean.TRUE, Boolean.TRUE,
486-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
486+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
487487
},
488488
new Object[]{
489489
DataType.TEXT,
490490
Boolean.TRUE, null, Boolean.FALSE,
491-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
491+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
492492
},
493493
new Object[]{
494494
DataType.TEXT,
495495
Boolean.TRUE, null, Boolean.TRUE,
496-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
496+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
497497
},
498498
new Object[]{
499499
DataType.TEXT,
500500
Boolean.TRUE, Boolean.FALSE, null,
501-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
501+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
502502
},
503503
new Object[]{
504504
DataType.TEXT,
505505
Boolean.TRUE, Boolean.FALSE, Boolean.FALSE,
506-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
506+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
507507
},
508508
new Object[]{
509509
DataType.TEXT,
510510
Boolean.TRUE, Boolean.FALSE, Boolean.TRUE,
511-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
511+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
512512
},
513513
new Object[]{
514514
DataType.TEXT,
515515
Boolean.TRUE, Boolean.TRUE, null,
516-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
516+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
517517
},
518518
new Object[]{
519519
DataType.TEXT,
520520
Boolean.TRUE, Boolean.TRUE, Boolean.FALSE,
521-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
521+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
522522
},
523523
new Object[]{
524524
DataType.TEXT,
525525
Boolean.TRUE, Boolean.TRUE, Boolean.TRUE,
526-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
526+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
527527
},
528528

529529
new Object[]{
530530
DataType.INT,
531531
Boolean.FALSE, null, Boolean.FALSE,
532-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
532+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
533533
},
534534
new Object[]{
535535
DataType.INT,
536536
Boolean.FALSE, null, Boolean.TRUE,
537-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
537+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
538538
},
539539
new Object[]{
540540
DataType.INT,
541541
Boolean.FALSE, Boolean.FALSE, null,
542-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
542+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
543543
},
544544
new Object[]{
545545
DataType.INT,
546546
Boolean.FALSE, Boolean.FALSE, Boolean.FALSE,
547-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
547+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
548548
},
549549
new Object[]{
550550
DataType.INT,
551551
Boolean.FALSE, Boolean.FALSE, Boolean.TRUE,
552-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
552+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
553553
},
554554
new Object[]{
555555
DataType.INT,
556556
Boolean.FALSE, Boolean.TRUE, null,
557-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
557+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
558558
},
559559
new Object[]{
560560
DataType.INT,
561561
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE,
562-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
562+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
563563
},
564564
new Object[]{
565565
DataType.INT,
566566
Boolean.FALSE, Boolean.TRUE, Boolean.TRUE,
567-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
567+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
568568
},
569569
new Object[]{
570570
DataType.INT,
571571
Boolean.TRUE, null, Boolean.FALSE,
572-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
572+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
573573
},
574574
new Object[]{
575575
DataType.INT,
576576
Boolean.TRUE, null, Boolean.TRUE,
577-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
577+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
578578
},
579579
new Object[]{
580580
DataType.INT,
581581
Boolean.TRUE, Boolean.FALSE, null,
582-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
582+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
583583
},
584584
new Object[]{
585585
DataType.INT,
586586
Boolean.TRUE, Boolean.FALSE, Boolean.FALSE,
587-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
587+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
588588
},
589589
new Object[]{
590590
DataType.INT,
591591
Boolean.TRUE, Boolean.FALSE, Boolean.TRUE,
592-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
592+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
593593
},
594594
new Object[]{
595595
DataType.INT,
596596
Boolean.TRUE, Boolean.TRUE, null,
597-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
597+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
598598
},
599599
new Object[]{
600600
DataType.INT,
601601
Boolean.TRUE, Boolean.TRUE, Boolean.FALSE,
602-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
602+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
603603
},
604604
new Object[]{
605605
DataType.INT,
606606
Boolean.TRUE, Boolean.TRUE, Boolean.TRUE,
607-
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`.",
607+
"`indexInverted` is deprecated and can not be set together with `indexFilterable` or `indexSearchable`",
608608
},
609609

610610
new Object[]{
611611
DataType.INT,
612612
null, null, Boolean.TRUE,
613-
"`indexSearchable` is allowed only for text/text[] data types. For other data types set false or leave empty",
613+
"`indexSearchable` is not allowed for other than text/text[] data types",
614614
},
615615
new Object[]{
616616
DataType.INT,
617617
null, Boolean.FALSE, Boolean.TRUE,
618-
"`indexSearchable` is allowed only for text/text[] data types. For other data types set false or leave empty",
618+
"`indexSearchable` is not allowed for other than text/text[] data types",
619619
},
620620
new Object[]{
621621
DataType.INT,
622622
null, Boolean.TRUE, Boolean.TRUE,
623-
"`indexSearchable` is allowed only for text/text[] data types. For other data types set false or leave empty",
623+
"`indexSearchable` is not allowed for other than text/text[] data types",
624624
},
625625
};
626626
}

0 commit comments

Comments
 (0)