2014-04-08 54 views
0

我正在使用Solar 4.6並更改了schema.xml中的內容。爲了更新schema.xml我的核心我用zkcli。哪些工作正常,我可以在Solr Admin GUI中看到cloud\tree\config\foobar\schema.xml下修改的schema.xmlSolr-Collection或Core不重裝schema.xml

但調用

  • http://localhost:8983/solr/admin/collections?action=RELOAD&name=foobar
  • http://localhost:8983/solr/admin/cores?action=RELOAD&name=foobar

schema.xml後仍然在覈心名爲foobar的。

回答

0

您必須在給它一個新的模式後重新加載核心。

在查詢中具有核心更換名稱:

/solr/admin/cores?action=RELOAD&**core**=yourcorename 

例如

http://localhost:8983/solr/admin/cores?action=RELOAD&core=foobar 
+0

這是一個正確的答案,另外,少技術的方式就是簡單地重新啓動你的Tomcat/Jetty服務器 –

0

你的第二個HTTP請求到核心API是錯誤的。更改namecore

http://localhost:8983/solr/admin/cores?action=RELOAD&name=foobar應該 http://localhost:8983/solr/admin/cores?action=RELOAD&core=foobar


http://archive.apache.org/dist/lucene/solr/ref-guide/apache-solr-ref-guide-4.6.pdf(頁277)

RELOAD

RELOAD動作加載從現有的結構的新的核心,註冊Solr的核心。在新核心正在初始化時,現有的 將繼續處理請求。當新的Solr內核準備好時,它接管並卸載舊的內核。

當您對磁盤上的Solr內核配置進行更改(如添加新的字段定義)時,此功能非常有用。調用RELOAD動作 可讓您應用新配置,而無需重新啓動Web容器。但是,核心容器不會保留SolrCloud solr.xml參數,例如solr/@zkHostsolr/cores/@hostPort,這些參數將被忽略。

http://localhost:8983/solr/admin/cores?action=RELOAD&core=core0

RELOAD動作接受單個參數,,其是被重新加載的芯的名稱。


也看到https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-RELOAD