I’m using Heroku for our app and I’ve started using Solr and the WebSolr add-on for full text search (with the Sunspot gem). I have Solr up and running on my development machine, but I want to simulate the production environment in order to debug some issues I’m seeing. Theoretically, I should be able to point to websolr in my config/sunspot.yml file and I should be able to search, correct? However, when I try to search, the request keeps timing out. I’ve verified that sunspot.yml is pointing to the right location:
development:
solr:
hostname: XXX.websolr.com
port: 8983
path: /solr/YYY
log_level: INFO
I’ve also tried running the app with the environment set to production, still no luck.
Any ideas?
Because Solr is open source software, you can run your own local instance of it, just like MySQL, PostgesQL, Redis, and so on.
Since you’re using Sunspot, it already provides a handy Rake task to start a local instance of Solr. You can run the following from within your Rails application:
That way, you don’t need to mess with your configs at all.
That said, if you specifically do want to interact with your index on Websolr from your development environment (which can be handy in some situations), then you’ll need to correct one tiny error in your
sunspot.yml:Namely, we’re using port 80.