Skip to content

Commit

Permalink
search through html content also
Browse files Browse the repository at this point in the history
  • Loading branch information
simonoff committed Nov 20, 2023
1 parent 1c15286 commit 23513ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models/article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ class Article < ApplicationRecord

include PgSearch::Model
pg_search_scope :search,
# against: [:title, :description]
# against: %i[title description],
# ignoring: :accents,
# using: [:trigram],
using: {
tsearch: { prefix: true }
tsearch: { prefix: true, dictionary: "english" }
},
associated_against: {
translations: %i[title description]
translations: %i[title description],
article_content: %i[html_content]
}

has_one :article_content, dependent: :destroy_async
Expand Down

0 comments on commit 23513ab

Please sign in to comment.