On 4 July 2016 at 18:50, Travis Fantina <[email protected]> wrote:
> Well I fixed it after much searching on Stack Overflow I realized that I
> needed to create an initializer for it:
>
> if Rails.env == "production"
>   url =
> 'https://search-shipit-search-6l6jwr5uhyg5evytk6o3unidya.us-east-1.es.amazonaws.com/'
>     Elasticsearch::Model.client = Elasticsearch::Client.new url: url
>   Searchkick.client = Elasticsearch::Client.new(hosts: url,
> retry_on_failure: true, transport_options: {request: {timeout: 250}})
> else
>   url = 'http://localhost:9200/'
>     Elasticsearch::Model.client = Elasticsearch::Client.new url: url
>   Searchkick.client = Elasticsearch::Client.new(hosts: url,
> retry_on_failure: true, transport_options: {request: {timeout: 250}})
> end
>
> Then I had to reindex the DB and migrate to Heroku.   Just to see if it
> would work I copied that code directly from an answer on Stack Overflow
> but now I'm wondering about the AWS url in the if statement, because
> that works for me but I have no idea where that URL is from since I
> don't personally have an AWS account, is there another more free place
> to host your Elasticsearch?   By using this URL am I hijacking someone
> else's AWS's account?

Click on the link and you will see what it is pointing to.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsKqq%3DLusXxJ79onpQ%2BnANsg0NpBzvJEzzcNhH9zT7ycQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to