Skip to content

Instantly share code, notes, and snippets.

@loe
Created December 13, 2011 18:52
Show Gist options
  • Select an option

  • Save loe/1473335 to your computer and use it in GitHub Desktop.

Select an option

Save loe/1473335 to your computer and use it in GitHub Desktop.
# Have the Source use the main_search database if it exists.
module ThinkingSphinx
class Source
def set_source_database_settings(source)
config = @database_configuration
source.sql_host = config[:main_search] || config[:host] || "localhost"
source.sql_user = config[:username] || config[:user] || 'root'
source.sql_pass = (config[:password].to_s || "").gsub('#', '\#')
source.sql_db = config[:database]
source.sql_port = config[:port]
source.sql_sock = config[:socket]
end
end
end
@loe

loe commented Dec 13, 2011

Copy link
Copy Markdown
Author

For Thinking Sphinx 1.4.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment