【问题标题】:SolrCloud OpenNLP error Can't find resource 'opennlp/en-sent.bin' in classpath or '/configs/_default'SolrCloud OpenNLP 错误在类路径或“/configs/_default”中找不到资源“opennlp/en-sent.bin”
【发布时间】:2018-09-05 12:22:08
【问题描述】:

在云模式下将 Apache OpenNLP 与 Solr(版本 7.3.0)一起使用时出现错误。 当我使用 open nlp 将字段类型添加到 managed-schema 时:

<fieldType name="text_opennlp" class="solr.TextField">
      <analyzer>
        <tokenizer class="solr.OpenNLPTokenizerFactory"
          sentenceModel="opennlp/en-sent.bin"
          tokenizerModel="opennlp/en-token.bin"
        />
      </analyzer>
    </fieldType>

    <field name="content" type="text_opennlp" indexed="true" termOffsets="true" stored="true" termPayloads="true" termPositions="true" docValues="false" termVectors="true" multiValued="true" required="true"/>

我有以下错误:

test_collection_shard1_replica_n1:org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:无法为核心 test_collection_shard1_replica_n1 加载 conf:无法加载架构托管架构:org.apache.solr.core。 SolrResourceNotFoundException:在类路径或“/configs/_default”中找不到资源“opennlp/en-sent.bin”,cwd=D:\utils\solr-7.3.0-7\solr-7.3.0-7\server请查看您的日志以获取更多信息

我已经从https://builds.apache.org/job/Solr-Artifacts-7.3/lastSuccessfulBuild/artifact/solr/package/下载了solr var 7.3.0-7

我尝试将模型文件放到:D:\utils\solr-7.3.0-7\solr-7.3.0-7\server,但没有帮助。

这是我的相关问题:Can not apply patch LUCENE-2899.patch to SOLR on Windows

也许我需要将模型文件放在其他地方?

【问题讨论】:

  • 也许有人用 apache open nlp 和 solr 知道这个模型应该放在哪里?
  • 也许我需要使用 Zookeeper 以某种方式上传文件,但我怎样才能正确地做到这一点?

标签: solr nlp solrcloud opennlp


【解决方案1】:

您需要将这些文件("en-sent.bin" 和另一个)放入核心的 conf 目录。

那是D:\utils\solr-7.3.0-7\solr-7.3.0-7\server\{core_name}\conf

然后直接使用文件。以下应该是xml配置。

<tokenizer class="solr.OpenNLPTokenizerFactory"
          sentenceModel="en-sent.bin"
          tokenizerModel="en-token.bin"
        />

【讨论】:

    猜你喜欢
    • 2018-07-18
    • 2013-08-24
    • 2016-06-15
    • 2019-01-06
    • 2023-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-20
    相关资源
    最近更新 更多