简体   繁体   中英

sunspot and solr

I'm currently try to get my sunspot / solr to work. In Dev its all fine and good. But when it comes to production, I'll get the following error.

RSolr::RequestError (Solr Response: Not Found):
  app/controllers/examples_controller.rb:48:in `update'

sunspot.yml looks like this:

 solr:
    hostname: localhost
    port: 8983
    path: '/opt/apache-solr-3.3.0/example'
    log_level: WARNING
    pid_dir: '/var/run'

Can anybody sort that out?

The path option is the path component of your Solr server's URL. It should read /solr rather than the filesystem path you have now. As it is, Sunspot is trying to connect to http://localhost:8983/opt/apache-solr-3.3.0/example ;)

The correct version:

solr:
   hostname: localhost
   port: 8983
   path: /solr
   log_level: WARNING
   pid_dir: /var/run

(Also, don't forget to copy Sunspot's standard schema.xml into your Solr directory somewhere under /opt/apache-solr-3.3.0)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM