Solr Error: Unable to create core [mycore] Caused by solr.ICUCollationField

Solr Error: Unable to create core [mycore] Caused by solr.ICUCollationField

我正在尝试创建一个 solr 核心,我将 drupalvm 与 vagrant 和 virtual box 一起使用。

使用此命令设置 solr 时:

sudo su - solr -c "/opt/solr/bin/solr create -c m4m -d /tmp/search_api_solr/solr-conf/7.x/"

我收到这个错误:

INFO  - 2018-11-05 19:21:45.804; org.apache.solr.util.configuration.SSLCredentialProviderFactory; Processing SSL Credential Provider chain: env;sysprop

ERROR: Error CREATEing SolrCore 'mycore': Unable to create core [mycore] Caused by: solr.ICUCollationField

在不指定 -d <confdir> 选项的情况下创建核心是成功的,但在 solr 仪表板和 Drupal UI 中给我一些非常奇怪的错误,研究表明这与损坏的核心有关。

对于我为什么会收到此错误的任何帮助,将不胜感激。使用相同 vagrant 安装的其他开发人员 运行 没有问题。

如果您在没有配置目录的情况下创建核心,solr 将使用它的默认配置。 反过来,将有 none 的 drupal 需要的字段定义,等等。 如果您对 solr 的结构了解一点,并且如果您使用 solr > 版本 7,您需要做的是:

  • go to where your solr installation is
  • cd /PATH_TO_SOLR/server/solr-webapp/webapp/WEB-INF/lib
  • Copy all jars from the analysis-extras folder to your wEB-INF/lib folder
  • cp /PATH_TO_SOLR/contrib/analysis-extras/lib/*.jar ./
  • restart solr the way you normally do, specifying your -d config directory. That's important.

希望这对您有所帮助。 要么... 省去您的麻烦,让专业人士使用 https://opensolr.com 之类的 SaaS 为您处理所有这一切 您只需单击 1 次即可创建 solr 索引,还需要再单击 2 次以上传您的配置文件,然后就完成了。

我需要来自 2 个目录的 jar:

cd /PATH_TO_SOLR
cp solr/contrib/analysis-extras/lib/*.jar solr/server/solr-webapp/webapp/WEB-INF/lib/
cp solr/contrib/analysis-extras/lucene-libs/*.jar solr/server/solr-webapp/webapp/WEB-INF/lib/

参见 solr/contrib/analysis-extras/README.txt