代码之家  ›  专栏  ›  技术社区  ›  Alexey Ponomarenko

SolrCloud OpenNLP错误无法找到已发送的资源“OpenNLP/en”。类路径中的bin或“/configs/\u default”

  •  0
  • Alexey Ponomarenko  · 技术社区  · 7 年前

    我在云模式下将Apache OpenNLP与Solr(7.3.0版)一起使用时出错。 当我将字段类型添加到 托管架构 像这样使用open nlp:

    <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\u collection\u shard1\u replica\u n1:组织。阿帕奇。solr公司。常见的SolrException:组织。阿帕奇。solr公司。常见的SolrException:无法加载core test\u collection\u shard1\u replica\u n1的conf:无法加载架构管理的架构:org。阿帕奇。solr公司。果心SolrResourceNotFoundException:找不到已发送的资源“opennlp/en”。classpath中的“bin”或“/configs/\u default”,cwd=D:\utils\solr-7.3.0-7\solr-7.3.0-7\server有关详细信息,请查看日志

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

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

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

    也许我需要把模型文件放在别的地方?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Arindam Nayak    6 年前

    你需要把那些文件( "en-sent.bin" 另一个)进入core的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"
            />