Package io.qdrant.client.utils
Class FilterUtil
java.lang.Object
io.qdrant.client.utils.FilterUtil
Utility class for creating filter conditions and filters.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Points.Condition
fieldCondition
(String key, Points.GeoBoundingBox geoBoundingBox) Creates aPoints.Condition
with aPoints.FieldCondition
for geo bounding box matching.static Points.Condition
fieldCondition
(String key, Points.GeoPolygon geoPolygon) Creates aPoints.Condition
with aPoints.FieldCondition
for geo polygon matching.static Points.Condition
fieldCondition
(String key, Points.GeoRadius geoRadius) Creates aPoints.Condition
with aPoints.FieldCondition
for geo radius matching.static Points.Condition
fieldCondition
(String key, Points.Match match) Creates aPoints.Condition
with aPoints.FieldCondition
for text matching.static Points.Condition
fieldCondition
(String key, Points.Range range) Creates aPoints.Condition
with aPoints.FieldCondition
for range matching.static Points.Condition
fieldCondition
(String key, Points.ValuesCount valuesCount) Creates aPoints.Condition
with aPoints.FieldCondition
for values count matching.static Points.Condition
filterCondition
(Points.Filter filter) Creates aPoints.Condition
with aPoints.Filter
as a subcondition.static Points.GeoBoundingBox
geoBoundingBox
(Points.GeoPoint topLeft, Points.GeoPoint bottomRight) Creates aPoints.GeoBoundingBox
based on the top-left and bottom-rightPoints.GeoPoint
s.static Points.GeoPoint
geoPoint
(double latitude, double longitude) Creates aPoints.GeoPoint
based on latitude and longitude values.static Points.GeoPolygon
geoPolygon
(Points.GeoLineString exterior, List<Points.GeoLineString> interiors) Creates aPoints.GeoPolygon
based on the exteriorPoints.GeoLineString
and a list of interiorPoints.GeoLineString
s.static Points.GeoRadius
geoRadius
(Points.GeoPoint center, float radius) Creates aPoints.GeoRadius
based on the centerPoints.GeoPoint
and radius.static Points.Condition
hasIdCondition
(List<Points.PointId> pointIds) Creates aPoints.Condition
with aPoints.HasIdCondition
based on a list of point IDs for ID condition matching.static Points.Condition
isEmptyCondition
(String key) Creates aPoints.Condition
with anPoints.IsEmptyCondition
based on a key for empty condition matching.static Points.Condition
isNullCondition
(String key) Creates aPoints.Condition
with anPoints.IsNullCondition
based on a key for null condition matching.static Points.Match
match
(boolean value) Creates aPoints.Match
condition for boolean matching.static Points.Match
match
(long value) Creates aPoints.Match
condition for integer matching.static Points.Match
Creates aPoints.Match
condition for string matching.static Points.Match
matchWithIntegers
(List<Long> integers) Creates aPoints.Match
condition with a list of integers for matching.static Points.Match
matchWithKeywords
(List<String> keywords) Creates aPoints.Match
condition with a list of keywords for matching.static Points.Filter
must
(Points.Condition... mustConditions) Creates aPoints.Filter
with "must" conditions.static Points.Filter
must
(List<Points.Condition> mustConditions) Creates aPoints.Filter
with "must" conditions.static Points.Filter
mustNot
(Points.Condition... mustNotConditions) Creates aPoints.Filter
with "must not" conditions.static Points.Filter
mustNot
(List<Points.Condition> mustNotConditions) Creates aPoints.Filter
with "must not" conditions.static Points.Condition
nestedCondition
(String key, Points.Filter filter) Creates aPoints.Condition
with aPoints.NestedCondition
based on a key and a nested filter.static Points.Range
range
(double lt, double gt, double gte, double lte) Creates aPoints.Range
for numeric range matching.static Points.Filter
should
(Points.Condition... shouldConditions) Creates aPoints.Filter
with "should" conditions.static Points.Filter
should
(List<Points.Condition> shouldConditions) Creates aPoints.Filter
with "should" conditions.static Points.ValuesCount
valuesCount
(long lt, long gt, long gte, long lte) Creates aPoints.ValuesCount
for values count matching.
-
Constructor Details
-
FilterUtil
public FilterUtil()
-
-
Method Details
-
fieldCondition
Creates aPoints.Condition
with aPoints.FieldCondition
for text matching.- Parameters:
key
- The key of the field.match
- The text match criteria.- Returns:
- The created condition.
-
fieldCondition
Creates aPoints.Condition
with aPoints.FieldCondition
for range matching.- Parameters:
key
- The key of the field.range
- The range criteria.- Returns:
- The created condition.
-
fieldCondition
Creates aPoints.Condition
with aPoints.FieldCondition
for geo bounding box matching.- Parameters:
key
- The key of the field.geoBoundingBox
- The geo bounding box criteria.- Returns:
- The created condition.
-
fieldCondition
Creates aPoints.Condition
with aPoints.FieldCondition
for geo radius matching.- Parameters:
key
- The key of the field.geoRadius
- The geo radius criteria.- Returns:
- The created condition.
-
fieldCondition
Creates aPoints.Condition
with aPoints.FieldCondition
for values count matching.- Parameters:
key
- The key of the field.valuesCount
- The values count criteria.- Returns:
- The created condition.
-
fieldCondition
Creates aPoints.Condition
with aPoints.FieldCondition
for geo polygon matching.- Parameters:
key
- The key of the field.geoPolygon
- The geo polygon criteria.- Returns:
- The created condition.
-
match
Creates aPoints.Match
condition for string matching. If the text contains a space, it is considered a full-text match. Else it is considered a keyword match.- Parameters:
text
- The text to match.- Returns:
- The created match condition.
-
match
Creates aPoints.Match
condition for integer matching.- Parameters:
value
- The integer value to match.- Returns:
- The created match condition.
-
match
Creates aPoints.Match
condition for boolean matching.- Parameters:
value
- The boolean value to match.- Returns:
- The created match condition.
-
matchWithKeywords
Creates aPoints.Match
condition with a list of keywords for matching.- Parameters:
keywords
- The list of keywords to match.- Returns:
- The created match condition.
-
matchWithIntegers
Creates aPoints.Match
condition with a list of integers for matching.- Parameters:
integers
- The list of integers to match.- Returns:
- The created match condition.
-
geoBoundingBox
public static Points.GeoBoundingBox geoBoundingBox(Points.GeoPoint topLeft, Points.GeoPoint bottomRight) Creates aPoints.GeoBoundingBox
based on the top-left and bottom-rightPoints.GeoPoint
s.- Parameters:
topLeft
- The top-left point of the bounding box.bottomRight
- The bottom-right point of the bounding box.- Returns:
- The created geo bounding box.
-
geoRadius
Creates aPoints.GeoRadius
based on the centerPoints.GeoPoint
and radius.- Parameters:
center
- The center point of the radius.radius
- The radius value.- Returns:
- The created geo radius.
-
geoPolygon
public static Points.GeoPolygon geoPolygon(Points.GeoLineString exterior, List<Points.GeoLineString> interiors) Creates aPoints.GeoPolygon
based on the exteriorPoints.GeoLineString
and a list of interiorPoints.GeoLineString
s.- Parameters:
exterior
- The exterior line string.interiors
- The list of interior line strings.- Returns:
- The created geo polygon.
-
range
Creates aPoints.Range
for numeric range matching.- Parameters:
lt
- The less than value.gt
- The greater than value.gte
- The greater than or equal to value.lte
- The less than or equal to value.- Returns:
- The created range.
-
valuesCount
Creates aPoints.ValuesCount
for values count matching.- Parameters:
lt
- The less than value.gt
- The greater than value.gte
- The greater than or equal to value.lte
- The less than or equal to value.- Returns:
- The created values count.
-
filterCondition
Creates aPoints.Condition
with aPoints.Filter
as a subcondition.- Parameters:
filter
- The filter criteria.- Returns:
- The created condition.
-
nestedCondition
Creates aPoints.Condition
with aPoints.NestedCondition
based on a key and a nested filter.- Parameters:
key
- The key of the nested condition.filter
- The nested filter criteria.- Returns:
- The created condition.
-
isEmptyCondition
Creates aPoints.Condition
with anPoints.IsEmptyCondition
based on a key for empty condition matching.- Parameters:
key
- The key of the field.- Returns:
- The created condition.
-
isNullCondition
Creates aPoints.Condition
with anPoints.IsNullCondition
based on a key for null condition matching.- Parameters:
key
- The key of the field.- Returns:
- The created condition.
-
hasIdCondition
Creates aPoints.Condition
with aPoints.HasIdCondition
based on a list of point IDs for ID condition matching.- Parameters:
pointIds
- The list of point IDs.- Returns:
- The created condition.
-
geoPoint
Creates aPoints.GeoPoint
based on latitude and longitude values.- Parameters:
latitude
- The latitude value.longitude
- The longitude value.- Returns:
- The created geo point.
-
must
Creates aPoints.Filter
with "must" conditions.- Parameters:
mustConditions
- The list of "must" conditions.- Returns:
- The created filter.
-
mustNot
Creates aPoints.Filter
with "must not" conditions.- Parameters:
mustNotConditions
- The list of "must not" conditions.- Returns:
- The created filter.
-
should
Creates aPoints.Filter
with "should" conditions.- Parameters:
shouldConditions
- The list of "should" conditions.- Returns:
- The created filter.
-
must
Creates aPoints.Filter
with "must" conditions.- Parameters:
mustConditions
- The list of "must" conditions.- Returns:
- The created filter.
-
mustNot
Creates aPoints.Filter
with "must not" conditions.- Parameters:
mustNotConditions
- The list of "must not" conditions.- Returns:
- The created filter.
-
should
Creates aPoints.Filter
with "should" conditions.- Parameters:
shouldConditions
- The list of "should" conditions.- Returns:
- The created filter.
-