first Install OpenJDK 8 JDK
To install OpenJDK 8 JDK using yum, run this command:
sudo yum install java-1.8.0-openjdk-devel
1.ps aux | grep solr
to get solr process ID
2.sudo kill <ID>
, is the ID you found from 1
3.rm -rvf <path/to/solr>
remove the solr directory inside your project to remove all of previous indexes
4.RAILS_ENV=production bundle exec rake sunspot
start
5.Change the path to /solr/default inside config/sunspot.yml
development:
solr:
hostname: localhost
port: 8982
log_level: INFO
path: /solr/default
6.重建索引
RAILS_ENV=production bundle exec rake sunspot
reindex