diff options
Diffstat (limited to 'app/models/node.rb')
| -rw-r--r-- | app/models/node.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/node.rb b/app/models/node.rb index 41c3867..a3ef23a 100644 --- a/app/models/node.rb +++ b/app/models/node.rb | |||
| @@ -211,11 +211,13 @@ class Node < ApplicationRecord | |||
| 211 | self.created_at < new_id_format_date ? unique_path : id | 211 | self.created_at < new_id_format_date ? unique_path : id |
| 212 | end | 212 | end |
| 213 | 213 | ||
| 214 | # TODO: restore full-text search once PostgreSQL is upgraded. | 214 | # Full-text search across all locale translations using PostgreSQL tsvector. |
| 215 | # The tsvector/plpgsql approach requires PostgreSQL 10+ with plpgsql available. | 215 | # Uses 'simple' dictionary (no stemming, no stopwords) so queries work |
| 216 | # For now, search is disabled to unblock the Rails 7.2 upgrade. | 216 | # across German and English content without language detection. |
| 217 | def self.search(term, _ = {}) | 217 | def self.search(term, _ = {}) |
| 218 | none | 218 | joins(head: :translations) |
| 219 | .where("page_translations.search_vector @@ plainto_tsquery('simple', ?)", term) | ||
| 220 | .distinct | ||
| 219 | end | 221 | end |
| 220 | 222 | ||
| 221 | protected | 223 | protected |
