Condition

@Serializable(with = ConditionSerializer::class)
sealed interface Condition

A single filter condition. Most conditions target a payload Field with a FieldMatcher; the rest cover Qdrant's special conditions (is_empty, is_null, has_id, has_vector, nested) and recursive nesting of a whole Filter via Sub.

Conditions are write-only: Qdrant never returns them, so the serializer does not implement deserialization.

Inheritors

Types

Link copied to clipboard
data class Field(val key: String, val matcher: FieldMatcher) : Condition

A condition on a payload field: {"key": ..., <matcher>}.

Link copied to clipboard
data class HasId(val ids: List<PointId>) : Condition

{"has_id": [...]} — point id is one of the given ids.

Link copied to clipboard
data class HasVector(val name: String) : Condition

{"has_vector": "name"} — the named vector is present ("" for the anonymous vector).

Link copied to clipboard
data class IsEmpty(val key: String) : Condition

{"is_empty": {"key": ...}} — field missing, null, or empty array.

Link copied to clipboard
data class IsNull(val key: String) : Condition

{"is_null": {"key": ...}} — field present but null.

Link copied to clipboard
data class Nested(val key: String, val filter: Filter) : Condition

{"nested": {"key": ..., "filter": {...}}} — sub-filter evaluated per array element.

Link copied to clipboard
data class Sub(val filter: Filter) : Condition

A nested boolean sub-filter, serialized as a plain Filter object.