How to know on Rails if Solr if up or not?

55 Views Asked by At

I'm using sunspot gem to manage a solr service to index information. I want to do a fordward way for when solr is down to continue showing things to my users going to the db instead of indexed data while the service is up again. In base of this I want know in some before actions if solr is up or not, but researching I could't find a way to ask it to Sunspot solr. Do you know a way to do it?

1

There are 1 best solutions below

0
Samuel-Zacharie Faure On

Solr is a separate server on your machine. Let's say it's supposed to be running on localhost:3001. You can just ping that address with a CURL request.