remove pg_search

This commit is contained in:
Georg Gadinger 2023-10-22 18:34:05 +02:00
parent c14bae74d5
commit d5c1e66b1e
6 changed files with 1 additions and 29 deletions

View file

@ -119,4 +119,3 @@ gem "mail", "~> 2.7.1"
gem "prometheus-client", "~> 4.2"
gem "pg_search", "~> 2.3"

View file

@ -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)
@ -545,7 +542,6 @@ DEPENDENCIES
oj
openssl (~> 3.2)
pg
pg_search (~> 2.3)
pghero
prometheus-client (~> 4.2)
puma

View file

@ -4,6 +4,6 @@ class SearchController < ApplicationController
query = params[:q]
return if query.blank?
@results = PgSearch.multisearch(query).limit(10)
@results = []
end
end

View file

@ -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

View file

@ -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

View file

@ -1,17 +0,0 @@
class CreatePgSearchDocuments < ActiveRecord::Migration[6.1]
def up
say_with_time("Creating table for pg_search multisearch") do
create_table :pg_search_documents do |t|
t.text :content
t.belongs_to :searchable, polymorphic: true, index: true
t.timestamps null: false
end
end
end
def down
say_with_time("Dropping table for pg_search multisearch") do
drop_table :pg_search_documents
end
end
end