Skip to content

Instantly share code, notes, and snippets.

@loe
Created December 13, 2011 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loe/1473335 to your computer and use it in GitHub Desktop.
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
Copy link
Author

loe commented Dec 13, 2011

For Thinking Sphinx 1.4.4

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