Everytime i try to reindex using...
rake sunspot:solr:reindex
These error messages always show:
Error - R
Upgrade Rsolr gem to latest version, 1.0.10.pre1, that worked for me.
Now I was able to reindex my models, and everything seems fine, in production that is.
With reference to @professormeowingtons, you don't have to delete entire solr directory as you might not want to delete your solr configurations like schema.xml
and solrconfig.xml
. The reason you are getting error might be because of corrupted indexes, what you can do is delete 'solr/env' i.e. solr/development
or/and solr/data/development
and restart solr server.
1. rake sunspot:solr:stop
2. rm -rf solr/development (Delete your solr/development directory)
3. rm -rf solr/data/development
4. rake sunspot:solr:start
5. rake sunspot:solr:reindex
If problem still persists, rollback your recent changes because you might have added some wrong configurations.
Check your sunspot server by localhost:8982 (depelopment). if you get same error like console. try again by localhost:8983 (production). for my case, port 8983 is work fine and I change sunspot config at rails/config/sunspot.yml to port :8983. and solved.
The solution:
rake sunspot:solr:stop
rm -rvf solr
(Delete your /solr directory)rake sunspot:solr:start
rake sunspot:solr:reindex
Enjoy
Based on the answer provided by @professormeowingtons, what worked for me in production is the following:
$ rake sunspot:solr:stop RAILS_ENV=production
$ rm -rvf solr # delete your /solr directory
$ sudo reboot # reboot the machine RAILS_ENV=production
$ rake sunspot:solr:start RAILS_ENV=production
$ rake sunspot:solr:reindex RAILS_ENV=production
For those of you that are using Websolr in Heroku production and getting this error when reindexing:
Remember that you have to upload your schema.xml manually in the Websolr admin GUI, under the "Advanced Configuration" tab when viewing your index.
Here's the direct link: https://websolr.com/slices/<index_uri>/schema
You can get the <index_uri>
from running heroku config
and getting it from the last part of your
WEBSOLR_URL that looks like this: http://index.websolr.com/solr/<index_uri>
I ran into this error because I mistakenly assumed that Websolr would just use the schema.xml
that I committed to git and pushed to heroku together with all the other <appname>/solr/conf
files.