Permalink
Browse files

Fix elastic search config with new Bonsai config vars

  • Loading branch information...
rwdaigle committed Oct 20, 2012
1 parent ae797d6 commit 862086126ae0e3b633ccdbb76fce870ec2a0bb4c
Showing with 7 additions and 8 deletions.
  1. +1 −1 app/assets/stylesheets/search.sass
  2. +1 −1 app/models/gist.rb
  3. +5 −6 config/initializers/{tire.rb → elasticsearch.rb}
@@ -32,7 +32,7 @@
font-size: 11px
line-height: 1.0
padding: 5px 2px 2px 8px
- text-shadow: -1px 2px 1px white
+ text-shadow: 1px -2px 1px white
border-top: 1px solid #BBB
text-align: center
View
@@ -8,7 +8,7 @@ class Gist < ActiveRecord::Base
belongs_to :user
has_many :files, :class_name => 'GistFile', :dependent => :delete_all
- index_name BONSAI_INDEX_NAME
+ index_name ELASTICSEARCH_INDEX_NAME
mapping do
indexes :description, :analyzer => 'snowball', :boost => 10
@@ -1,11 +1,10 @@
require 'yajl/json_gem'
-Tire.configure do
- url ENV['BASE_BONSAI_URL']
- BONSAI_INDEX_NAME = ENV['BONSAI_INDEX_URL'][/[^\/]+$/]
- # url ENV['SEARCHBOX_URL']
- logger STDOUT, :level => ENV['LOG_LEVEL']
-end
+ENV['ELASTICSEARCH_URL'] = ENV['BONSAI_URL']
+
+# Optional, but recommended: use a single index per application per environment
+app_name = Rails.application.class.parent_name.underscore.dasherize
+ELASTICSEARCH_INDEX_NAME = "#{app_name}-#{Rails.env}"
module Tire
class Logger

0 comments on commit 8620861

Please sign in to comment.