Add a postgress freetext index on the note comments, and enable note searching using freetext matching.
11 lines
322 B
Ruby
11 lines
322 B
Ruby
require 'migrate'
|
|
|
|
class AddTextIndexToNoteComments < ActiveRecord::Migration
|
|
def up
|
|
add_index :note_comments, [], :columns => "to_tsvector('english', body)", :method => "GIN", :name => "index_note_comments_on_body"
|
|
end
|
|
|
|
def down
|
|
remove_index :note_comments, :name => "index_note_comments_on_body"
|
|
end
|
|
end
|