简体   繁体   English

太阳黑子+ Solr 5.2(最新)

[英]Sunspot + Solr 5.2 (latest)

I don't know where to put this, I can move it to Stack Overflow if you want. 我不知道将其放在何处,如果需要,可以将其移至Stack Overflow。

I'm new at Sunspot and Rails, and I have use it before with Solr 4.X running over Tomcat7 without issues, I was happy. 我是Sunspot和Rails的新手,之前在Tomcat7上无问题地运行Solr 4.X时就使用了它,对此我感到很高兴。 Now, I'm deploying a new app, and I want to use Solr 5.2 which is the latest, this one doesn't run on top of Tomcat like his predecessors, it's now a nice standalone service running on top of a jetty instance. 现在,我正在部署一个新的应用程序,并且我想使用最新的Solr 5.2,它不像他的前辈那样运行在Tomcat之上,它现在是一个运行在码头实例之上的不错的独立服务。

So, I followed this guid to install it https://www.digitalocean.com/community/tutorials/how-to-install-solr-5-2-1-on-ubuntu-14-04 因此,我按照此指南进行了安装:https://www.digitalocean.com/community/tutorials/how-to-install-solr-5-2-1-on-ubuntu-14-04

I have even creating a collection and stuff, but when I do rake sunspot:reindex it returned the following error: 我什至创建了一个集合和其他东西,但是当我rake sunspot:reindex它返回以下错误:

RSolr::Error::Http: RSolr::Error::Http - 400 Bad Request Error: {'responseHeader'=>{'status'=>400,'QTime'=>127},'error'=>{'msg'=>'undefined field type','code'=>400}} URI: http://localhost:8983/solr/screencap-dev/update?wt=ruby Request Headers: {"Content-Type"=>"text/xml"} Request Data: "<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?><delete><query>type:[MODEL NAME]</query></delete>"

That [MODEL NAME] is the name of the model I'm indexing. [MODEL NAME]是我正在索引的模型的名称。

I can't make it work, so I'm using the sunspot_solr version, I even tried to move every config file over to my Solr 5.2 without success, Server errors and stuff. 我无法使其正常运行,所以我使用的是sunspot_solr版本,我什至尝试将每个配置文件都移到Solr 5.2上,但没有成功,服务器错误和其他问题。

Did anyone did this already? 有人做过吗?

UPDATE UPDATE

I have tried to copy the collection files from sunspot_solr (Solr 5.0.0) to my Solr Service (Solr 5.2.0), I got it to load the files, but: 我尝试将收集文件从sunspot_solr(Solr 5.0.0)复制到我的Solr Service(Solr 5.2.0),我可以用它来加载文件,但是:

Error CREATEing SolrCore 'screencap-dev': Unable to create core [screencap-dev] Caused by: solr.DateField

Obviously Sunspot collections files are not compatible. 显然,Sunspot集合文件不兼容。

Your solr instance is broken. 您的Solr实例已损坏。

These are the terminal commands you should follow to solve your problems: 这些是解决问题应遵循的终端命令:

  1. ps aux | ps aux | grep solr to get solr process ID grep solr获取solr进程ID
  2. sudo kill , is the ID you found from 1 sudo kill,是您从1中找到的ID
  3. rm -r , remove the solr directory inside your project to rm -r,删除项目内的solr目录以
  4. remove all of previous indexes 删除所有先前的索引
  5. RAILS_ENV=development bundle exec rake sunspot:solr:start RAILS_ENV =开发捆绑包执行rake sunspot:solr:start
  6. Change the path to /solr/default inside config/sunspot.yml 将路径更改为config / sunspot.yml中的/ solr / default
  7. RAILS_ENV=development bundle exec rake sunspot:solr:reindex RAILS_ENV =开发包执行程序rake sunspot:solr:reindex

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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