我在尝试使用Sunspot设计时遇到了多个问题。
当我试图查看索引页面时,我收到以下错误消息:
RSsr :: Error :: ConnectionRefused in PostsController #index 拒绝连接 - {:data =>“fq = type%3APost& start = 0& rows = 30& q = %3A ”,: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 / development / select?wt = ruby> ,: open_timeout => nil,:read_timeout => nil,:retry_503 => nil,:retry_after_limit => nil}
# GET /posts.json
def index
@search = Post.search do
fulltext params[:search]
end
@posts = @search.results
如果我在帖子控制器中进行以下更改:
def index
@posts = Post.all
end
索引页面显示正确,但我仍然无法创建新的帖子条目,因为当我尝试保存它时,我收到另一个错误:
RSsr :: Error :: ConnectionRefused在PostsController #create中 拒绝连接 - {:data =>“发布3PostActiveRecord :: BasePostfdafafaf”,:headers => {“Content-Type”=>“text / xml”},:method =>:post,:params =&gt ; {:wt =>:ruby},:query =>“wt = ruby”,:path =>“update”,:uri => #http:// localhost:8982 / solr / development / update ?wt = ruby> ,: open_timeout => nil,:read_timeout => nil,:retry_503 => nil,:retry_after_limit => nil}
respond_to do | format |
if @post.save
format.html { redirect_to @post, notice: 'Post was successfully created.' }
format.json { render :show, status: :created, location: @post }
else
知道如何修复这些错误吗?
由于