From 69ca5b9938931785a65945b80be409b6a0169069 Mon Sep 17 00:00:00 2001 From: Ralph Gasser Date: Thu, 28 Nov 2024 10:42:07 +0100 Subject: [PATCH] Minor cleanup. Signed-off-by: Ralph Gasser --- .../descriptor/vector/VectorDescriptorReader.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/vector/VectorDescriptorReader.kt b/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/vector/VectorDescriptorReader.kt index 1566237e..fbf5d889 100644 --- a/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/vector/VectorDescriptorReader.kt +++ b/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/vector/VectorDescriptorReader.kt @@ -32,15 +32,15 @@ class VectorDescriptorReader(field: Schema.Field<*, VectorDescriptor<*, *>>, con */ override fun query(query: Query): Sequence> = sequence { when (val predicate = query.predicate) { - is ProximityPredicate<*> -> prepareProximity(predicate).use { stmt -> - stmt.executeQuery().use { result -> - while (result.next()) { - yield(rowToDescriptor(result)) - } - } - } + is ProximityPredicate<*> -> prepareProximity(predicate) is BooleanPredicate -> prepareBoolean(predicate) else -> throw UnsupportedOperationException("Query of typ ${query::class} is not supported by VectorDescriptorReader.") + }.use { stmt -> + stmt.executeQuery().use { result -> + while (result.next()) { + yield(rowToDescriptor(result)) + } + } } }