Ich habe zwei ModellePg_search Migration nicht Spalte hinzufügen
class Post < ApplicationRecord
include PgSearch
multisearchable :against => [:title, :content]
...
class Question < ApplicationRecord
include PgSearch
multisearchable :against => [:title, :content]
Ich betreibe Befehl
rails g pg_search:migration:multisearch
Seine diese Migration erzeugen
class CreatePgSearchDocuments < ActiveRecord::Migration
def self.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 self.down
say_with_time("Dropping table for pg_search multisearch") do
drop_table :pg_search_documents
end
end
end
Seine Spalte nicht hinzufügen Titel. Warum?
Aktualisieren. Pg_Search verkettet Spaltentitel und Inhalt in einer Spalte - Inhalt. Ich verstehe nicht warum.
Rails 5.0.2
Rubin rubin 2.3.3p222 (2016.11.21 Revision 56859) [x86_64-Linux]