lib/pg_search/features/tsearch.rb in pg_search-0.1 vs lib/pg_search/features/tsearch.rb in pg_search-0.1.1

- old
+ new

@@ -38,10 +38,10 @@ sanitized_term = term.gsub(/['?\-\\]/, " ") term_sql = @normalizer.add_normalization(connection.quote(sanitized_term)) # After this, the SQL expression evaluates to a string containing the term surrounded by single-quotes. - tsquery_sql = "#{connection.quote("'")} || #{term_sql} || #{connection.quote("'")}" + tsquery_sql = "#{connection.quote("' ")} || #{term_sql} || #{connection.quote(" '")}" # Add tsearch prefix operator if we're using a prefix search. tsquery_sql = "#{tsquery_sql} || #{connection.quote(':*')}" if @options[:prefix] "to_tsquery(#{":dictionary," if @options[:dictionary]} #{tsquery_sql})"