gpt4 book ai didi

ruby-on-rails - Rails - 安装后 Sunspot Solr 404 错误

转载 作者:行者123 更新时间:2023-12-04 06:14:27 25 4
gpt4 key购买 nike

我刚刚在我的 Rails 应用程序中安装了 Sunspot Solr,在启动服务器后,我收到了这个错误..

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"

导致所有这些困惑的代码行是这样的:

# sunspot stuff
@search = Question.search do
fulltext query
end
@questions = @search.results

有人见过这个 Solr 404 错误吗?我确实在网络上搜索了现有的 solr 问题,但没有找到这个问题。谢谢。

最佳答案

我意识到这已经很老了,您可能已经解决了它,但我能够通过注释掉 sunspot.yml 文件中的路径来解决这个问题。

它来自(失败):

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

到(工作)

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

关于ruby-on-rails - Rails - 安装后 Sunspot Solr 404 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9832639/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com