Skip to content

Commit

Permalink
Fixes a bug in fulltext queries for scalar attributes.
Browse files Browse the repository at this point in the history
Signed-off-by: Ralph Gasser <[email protected]>
  • Loading branch information
ppanopticon committed Dec 5, 2024
1 parent c5520ed commit a44e4d0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ScalarDescriptorReader(field: Schema.Field<*, ScalarDescriptor<*, *>>, con
*/
private fun queryFulltext(query: SimpleFulltextQuery): Sequence<ScalarDescriptor<*, *>> {
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)
Expand Down

0 comments on commit a44e4d0

Please sign in to comment.