Add search form for hidden content

Added search for comments and proposal_notifications, added tsv column
for search and rake tasks to update/create tsv vector.
This commit is contained in:
Jacek Skrzypacz
2019-03-20 11:35:41 +01:00
committed by Javi Martín
parent e66b9687a2
commit 2af7e32415
19 changed files with 254 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
class AddTsvectorToCommentsAndProposalNotifications < ActiveRecord::Migration[5.2]
def change
add_column :comments, :tsv, :tsvector
add_index :comments, :tsv, using: "gin"
add_column :proposal_notifications, :tsv, :tsvector
add_index :proposal_notifications, :tsv, using: "gin"
end
end

View File

@@ -448,6 +448,7 @@ ActiveRecord::Schema.define(version: 2021_11_03_112944) do
t.string "ancestry"
t.integer "confidence_score", default: 0, null: false
t.boolean "valuation", default: false
t.tsvector "tsv"
t.index ["ancestry"], name: "index_comments_on_ancestry"
t.index ["cached_votes_down"], name: "index_comments_on_cached_votes_down"
t.index ["cached_votes_total"], name: "index_comments_on_cached_votes_total"
@@ -455,6 +456,7 @@ ActiveRecord::Schema.define(version: 2021_11_03_112944) do
t.index ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type"
t.index ["confidence_score"], name: "index_comments_on_confidence_score"
t.index ["hidden_at"], name: "index_comments_on_hidden_at"
t.index ["tsv"], name: "index_comments_on_tsv", using: :gin
t.index ["user_id"], name: "index_comments_on_user_id"
t.index ["valuation"], name: "index_comments_on_valuation"
end
@@ -1268,6 +1270,8 @@ ActiveRecord::Schema.define(version: 2021_11_03_112944) do
t.datetime "hidden_at"
t.datetime "ignored_at"
t.datetime "confirmed_hide_at"
t.tsvector "tsv"
t.index ["tsv"], name: "index_proposal_notifications_on_tsv", using: :gin
end
create_table "proposal_translations", id: :serial, force: :cascade do |t|