QueryInterface

@Serializable(with = QueryInterfaceSerializer::class)
sealed interface QueryInterface

The query of a /points/query request: what to do with the (optionally prefetched) candidates.

Request-only — Qdrant never returns a query, so this type serializes but does not deserialize.

Inheritors

Types

Link copied to clipboard
data class ById(val id: PointId) : VectorInput

Nearest-neighbor search reusing the stored vector of an existing point ("more like this").

Link copied to clipboard
data class Context(val pairs: List<ContextPair> = emptyList()) : QueryInterface

Context search: no target, only pairs steering the result region.

Link copied to clipboard
data class Discover(val target: VectorInput, val context: List<ContextPair> = emptyList()) : QueryInterface

Guided search: rank by proximity to target, constrained by context example pairs.

Link copied to clipboard
data class Fusion(val algorithm: FusionAlgorithm, val rrfK: Int? = null, val rrfWeights: List<Float>? = null) : QueryInterface

Fuse the rankings of several Prefetch sources — the basis of hybrid search. Build it with rrf (Reciprocal Rank Fusion, optionally parameterized) or dbsf.

Link copied to clipboard
data class MultiVector(val vectors: List<List<Float>>) : VectorInput

Nearest-neighbor search by a multi-vector / late-interaction (ColBERT) query: [[...],[...]].

Link copied to clipboard
data class OrderBy(val key: String, val direction: Direction? = null) : QueryInterface

Order points by a payload key (ascending by default).

Link copied to clipboard
data class Recommend(val positive: List<VectorInput> = emptyList(), val negative: List<VectorInput> = emptyList(), val strategy: RecommendStrategy? = null) : QueryInterface

Recommend points close to the positive examples and far from the negative ones.

Link copied to clipboard
data object Sample : QueryInterface

Return a random sample of points.

Link copied to clipboard
data class Sparse(val indices: List<Int>, val values: List<Float>) : VectorInput

Nearest-neighbor search by a sparse query vector. Serializes to {"indices":[...],"values":[...]}.

Link copied to clipboard
data class Vector(val values: List<Float>) : VectorInput

Nearest-neighbor search by an explicit dense vector. Serializes to a bare JSON array.

Link copied to clipboard
class VectorArray(val values: FloatArray) : VectorInput

Nearest-neighbor search by a dense vector backed by a FloatArray — a zero-boxing fast path that serializes straight to a bare JSON array. Equality is by content.