Rails - Sunspot Solr 404 Error After Installation
I just installed Sunspot Solr in my rails application and after starting the server, I get this error.
Started GET "/faq/search?search=blueberry" for 143.183.25.73 at 2012-03-22 17:34:27 -0700
Processing by FaqController#search as
Parameters: {"search"=>"blueberry"}
Keyword Load (0.8ms) SELECT distinct(content) FROM `keywords` LIMIT 30
SOLR Request (5.2ms) [ path=#<RSolr::Client:0x000000033c1808> parameters={data: fq=type%3AQuestion&q=blueberry&fl=%2A+score&qf=content_text&defType=dismax&start=0&rows=30, method: post, params: {:wt=>:ruby}, query: wt=ruby, headers: {"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}, path: select, uri: http://localhost:8982/solr/select?wt=ruby, open_timeout: , read_timeout: } ]
Completed 500 Internal Server Error in 35ms
RSolr::Error::Http (RSolr::Error::Http - 404 Not Found
Error: NOT_FOUND
Request Data: "fq=type%3AQuestion&q=blueberry&fl=%2A+score&qf=content_text&defType=dismax&start=0&rows=30"
The line of code that's causing all this mess is this:
# sunspot stuff
@search = Question.search do
fulltext query
end
@questions = @search.results
Has anyone seen this Solr 404 error? I have looked at the existing solr problems on the internet but did not find this problem. Thank.
+3
source to share
1 answer
I realize this is quite old and you may have solved it already, but I was able to fix this problem by commenting out the path in the sunspot.yml file.
This happened (failed):
production:
solr:
hostname: localhost
port: 8080
log_level: WARNING
path: /solr/production
# read_timeout: 2
# open_timeout: 0.5
development:
solr:
hostname: 0.0.0.0
port: 8982
log_level: INFO
path: /solr/development
test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
path: /solr/test
to (working)
production:
solr:
hostname: localhost
port: 8080
log_level: WARNING
#path: /solr/production
# read_timeout: 2
# open_timeout: 0.5
development:
solr:
hostname: 0.0.0.0
port: 8982
log_level: INFO
#path: /solr/development
test:
solr:
hostname: localhost
port: 8981
log_level: WARNING
#path: /solr/test
+3
source to share