Skip to content

Commit e4fc6ca

Browse files
committed
feat: add dedicated UUID filter methods
1 parent 18cbb4a commit e4fc6ca

1 file changed

Lines changed: 40 additions & 2 deletions

File tree

  • src/main/java/io/weaviate/client6/v1/api/collections/query

src/main/java/io/weaviate/client6/v1/api/collections/query/Filter.java

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ public Filter not() {
110110
// --------------------------------------------------------------------------
111111

112112
/** Filter by object UUID. */
113-
public static FilterBuilder uuid() {
114-
return property(BaseQueryOptions.ID_PROPERTY);
113+
public static UuidProperty uuid() {
114+
return new UuidProperty();
115115
}
116116

117117
/** Filter by object creation time. */
@@ -645,6 +645,44 @@ public String toString() {
645645
}
646646
}
647647

648+
public static class UuidProperty extends PathOperand {
649+
private UuidProperty() {
650+
super(BaseQueryOptions.ID_PROPERTY);
651+
}
652+
653+
public Filter eq(String value) {
654+
return new Filter(Operator.EQUAL, this, new TextOperand(value));
655+
}
656+
657+
public Filter ne(String value) {
658+
return new Filter(Operator.NOT_EQUAL, this, new TextOperand(value));
659+
}
660+
661+
public Filter gt(String value) {
662+
return new Filter(Operator.GREATER_THAN, this, new TextOperand(value));
663+
}
664+
665+
public Filter gte(String value) {
666+
return new Filter(Operator.GREATER_THAN_EQUAL, this, new TextOperand(value));
667+
}
668+
669+
public Filter lt(String value) {
670+
return new Filter(Operator.LESS_THAN, this, new TextOperand(value));
671+
}
672+
673+
public Filter lte(String value) {
674+
return new Filter(Operator.LESS_THAN_EQUAL, this, new TextOperand(value));
675+
}
676+
677+
public Filter containsAny(String... values) {
678+
return new Filter(Operator.CONTAINS_ANY, this, new TextArrayOperand(values));
679+
}
680+
681+
public Filter containsNone(String... values) {
682+
return new Filter(Operator.CONTAINS_NONE, this, new TextArrayOperand(values));
683+
}
684+
}
685+
648686
public static class DateProperty extends PathOperand {
649687
private DateProperty(String propertyName) {
650688
super(propertyName);

0 commit comments

Comments
 (0)