diff --git a/app/models/search/query.rb b/app/models/search/query.rb index 7d96d5170..5fe0829e4 100644 --- a/app/models/search/query.rb +++ b/app/models/search/query.rb @@ -5,6 +5,8 @@ class Search::Query < ApplicationRecord validates :terms, presence: true before_validation :sanitize_terms + delegate :to_s, to: :terms + class << self def wrap(query) if query.is_a?(self) @@ -15,13 +17,6 @@ class Search::Query < ApplicationRecord end end - def to_s - # Return unstemmed terms - each adapter handles stemming appropriately: - # - SQLite: FTS5 Porter tokenizer stems automatically - # - MySQL: Search::Record.matching applies stemming - terms.to_s - end - private def sanitize_terms self.terms = sanitize(terms)