Skip to content

Commit

Permalink
remove pg_search
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsding committed Oct 22, 2023
1 parent c14bae7 commit d5c1e66
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 29 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,3 @@ gem "mail", "~> 2.7.1"

gem "prometheus-client", "~> 4.2"

gem "pg_search", "~> 2.3"
4 changes: 0 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,6 @@ GEM
ast (~> 2.4.1)
racc
pg (1.5.4)
pg_search (2.3.6)
activerecord (>= 5.2)
activesupport (>= 5.2)
pghero (3.3.4)
activerecord (>= 6)
prometheus-client (4.2.1)
Expand Down Expand Up @@ -545,7 +542,6 @@ DEPENDENCIES
oj
openssl (~> 3.2)
pg
pg_search (~> 2.3)
pghero
prometheus-client (~> 4.2)
puma
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ def index
query = params[:q]
return if query.blank?

@results = PgSearch.multisearch(query).limit(10)
@results = []
end
end
3 changes: 0 additions & 3 deletions app/models/answer.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
class Answer < ApplicationRecord
extend Answer::TimelineMethods

include PgSearch::Model
multisearchable against: [:content]

belongs_to :user, counter_cache: :answered_count
belongs_to :question, counter_cache: :answer_count
has_many :comments, dependent: :destroy
Expand Down
3 changes: 0 additions & 3 deletions app/models/question.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
class Question < ApplicationRecord
include Question::AnswerMethods

include PgSearch::Model
multisearchable against: [:content]

belongs_to :user, optional: true
has_many :answers, dependent: :destroy
has_many :inboxes, dependent: :destroy
Expand Down
17 changes: 0 additions & 17 deletions db/migrate/20231022155815_create_pg_search_documents.rb

This file was deleted.

0 comments on commit d5c1e66

Please sign in to comment.