Reenable the note search API
Add a postgress freetext index on the note comments, and enable note searching using freetext matching.
This commit is contained in:
parent
a4561fe89b
commit
45618726ef
5 changed files with 71 additions and 60 deletions
11
db/migrate/20140115192822_add_text_index_to_note_comments.rb
Normal file
11
db/migrate/20140115192822_add_text_index_to_note_comments.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue