From a44e4d010db336ccb0e5ea14d6a9cedd2ee8ed1a Mon Sep 17 00:00:00 2001 From: Ralph Gasser Date: Thu, 5 Dec 2024 15:22:09 +0100 Subject: [PATCH] Fixes a bug in fulltext queries for scalar attributes. Signed-off-by: Ralph Gasser --- .../pgvector/descriptor/scalar/ScalarDescriptorReader.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/scalar/ScalarDescriptorReader.kt b/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/scalar/ScalarDescriptorReader.kt index a077e61b..650cf1ca 100644 --- a/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/scalar/ScalarDescriptorReader.kt +++ b/vitrivr-engine-module-pgvector/src/main/kotlin/org/vitrivr/engine/database/pgvector/descriptor/scalar/ScalarDescriptorReader.kt @@ -65,7 +65,7 @@ class ScalarDescriptorReader(field: Schema.Field<*, ScalarDescriptor<*, *>>, con */ private fun queryFulltext(query: SimpleFulltextQuery): Sequence> { val queryString = query.value.value.split(" ").map { "$it:*" }.joinToString(" | ") { it } - val statement = "SELECT * FROM \"${tableName.lowercase()}\" WHERE ${query.attributeName} @@ to_tsquery(?)" + val statement = "SELECT * FROM \"${tableName.lowercase()}\" WHERE $VALUE_ATTRIBUTE_NAME @@ to_tsquery(?)" return sequence { this@ScalarDescriptorReader.connection.jdbc.prepareStatement(statement).use { stmt -> stmt.setString(1, queryString)