Interface PropertyFilter
-
- All Implemented Interfaces:
public interface PropertyFilterFilter expression for property-based filtering on key-value maps.
A safe, composable expression tree that can be used for:
Metadata filtering: Applied to metadata maps
Property filtering: Applied to object property maps or typed entity fields
Guard conditions: LLM-generatable expressions for safe condition evaluation
Backends can translate this to native query syntax (Lucene field queries, Cypher WHERE clauses, etc.) and fall back to InMemoryPropertyFilter for post-filtering when native filtering isn't available.
Limitation: Nested Properties Not Supported
Filters operate on top-level properties only. Nested property paths like
"address.city"or"metadata.source"are not supported. The filter key must match a direct key in the target map or a top-level property on the target object.Kotlin users can use operator syntax for combining filters:
val filter = (eq("owner", "alice") and gte("score", 0.8)) or eq("role", "admin") val excluded = !eq("status", "deleted")
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPropertyFilter.EqEquals: propertieskey == value
public final classPropertyFilter.NeNot equals: propertieskey != value
public final classPropertyFilter.GtGreater than: propertieskey value
public final classPropertyFilter.GteGreater than or equal: propertieskey>= value
public final classPropertyFilter.LtLess than: propertieskey< value
public final classPropertyFilter.LteLess than or equal: propertieskey<= value
public final classPropertyFilter.InIn list: propertieskey in values
public final classPropertyFilter.NinNot in list: propertieskey not in values
public final classPropertyFilter.ContainsContains substring: propertieskey.toString().contains(value)
public final classPropertyFilter.ContainsIgnoreCaseContains substring (case-insensitive): propertieskey.toString().lowercase().contains(value.lowercase())
public final classPropertyFilter.EqIgnoreCaseEquals (case-insensitive): propertieskey.toString().lowercase() == value.lowercase()
public final classPropertyFilter.StartsWithStarts with prefix: propertieskey.toString().startsWith(value)
public final classPropertyFilter.EndsWithEnds with suffix: propertieskey.toString().endsWith(value)
public final classPropertyFilter.LikeRegex pattern match: propertieskey.toString().matches(Regex(pattern))
Uses Java/Kotlin regex syntax. For case-insensitive matching, use the (?i) flag at the start of the pattern.
public final classPropertyFilter.AndLogical AND: all filters must match
public final classPropertyFilter.OrLogical OR: at least one filter must match
public final classPropertyFilter.NotLogical NOT: filter must not match
public classPropertyFilter.Companion
-
Method Summary
Modifier and Type Method Description PropertyFilternot()Logical NOT operator: !filterPropertyFilterand(PropertyFilter other)Logical AND infix: filter1 and filter2PropertyFilteror(PropertyFilter other)Logical OR infix: filter1 or filter2-
-
Method Detail
-
not
PropertyFilter not()
Logical NOT operator:
!filter
-
and
PropertyFilter and(PropertyFilter other)
Logical AND infix:
filter1 and filter2
-
or
PropertyFilter or(PropertyFilter other)
Logical OR infix:
filter1 or filter2
-
-
-
-