brewster / elastictastic

Object-document mapper and lightweight API adapter for ElasticSearch
MIT License
88 stars 13 forks source link

Enable hosts in a subpath #31

Closed mrcasals closed 11 years ago

mrcasals commented 11 years ago

Work in progress: This PR enables hosts in a subpath. This is needed when configuring ElasticTastic to work with Heroku ElasticSearch Addons.

mrcasals commented 11 years ago

I'm having problems configuring ElasticTastic on Heroku. I found this code that creates the default host given some parameters:

https://github.com/brewster/elastictastic/blob/master/lib/elastictastic/configuration.rb#L81-L83

My Heorku addon gives me an env variable (ENV['SEARCHBOX_URL'], which looks like http://api.searchbox.io/api-key/<my_key>), so in my config/env/production.rb file I did this:

ENV['ELASTICSEARCH_URL'] = ENV['SEARCHBOX_URL']

But Elastictastic gives me this error:

bad URI(is not URI?): http://api.searchbox.io/api-key/<my_key>

Any idea on this?

outoftime commented 11 years ago

It looks like there should be a #to_s call in the method you modified (my fault), since in the default case a String is returned. Want to make that fix and I'll merge in?

mrcasals commented 11 years ago

Done :)

outoftime commented 11 years ago

Released in a new patchlevel -- thanks!

mrcasals commented 11 years ago

Thank you! On Jan 9, 2013 5:58 PM, "Mat Brown" notifications@github.com wrote:

Released in a new patchlevel -- thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/brewster/elastictastic/pull/31#issuecomment-12054301.