Permalink
Browse files

Switch to bonsai for elasticsearch

  • Loading branch information...
rwdaigle committed Oct 6, 2012
1 parent 3ff6339 commit d0e5a3de7996cc3056a07c9e1a7736d3b00c19db
Showing with 5 additions and 1 deletion.
  1. +2 −0 app/models/gist.rb
  2. +3 −1 config/initializers/tire.rb
View
@@ -8,6 +8,8 @@ class Gist < ActiveRecord::Base
belongs_to :user
has_many :files, :class_name => 'GistFile', :dependent => :delete_all
+ index_name BONSAI_INDEX_NAME
+
mapping do
indexes :description, :analyzer => 'snowball', :boost => 10
indexes :gh_created_at, type: 'date'
@@ -1,7 +1,9 @@
require 'yajl/json_gem'
Tire.configure do
- url ENV['SEARCHBOX_URL']
+ url ENV['BASE_BONSAI_URL']
+ BONSAI_INDEX_NAME = ENV['BONSAI_INDEX_URL'][/[^\/]+$/]
+ # url ENV['SEARCHBOX_URL']
logger STDOUT, :level => ENV['LOG_LEVEL']
end

0 comments on commit d0e5a3d

Please sign in to comment.