SolrCloud OpenNLP错误在类路径或"/configs/_default"中找不到资源"opennlp/en-sent.bin" [英] SolrCloud OpenNLP error Can't find resource 'opennlp/en-sent.bin' in classpath or '/configs/_default'
问题描述
在Cloud模式下将Apache OpenNLP与Solr(版本7.3.0)一起使用时出现错误. 当我像这样使用open nlp将字段类型添加到 managed-schema 时:
I have error when using Apache OpenNLP with Solr (ver. 7.3.0) in Cloud mode. When I add field type to managed-schema using open nlp like this:
<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请检查您的日志以获取更多信息
test_collection_shard1_replica_n1: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load conf for core test_collection_shard1_replica_n1: Can't load schema managed-schema: org.apache.solr.core.SolrResourceNotFoundException: Can't find resource 'opennlp/en-sent.bin' in classpath or '/configs/_default', cwd=D:\utils\solr-7.3.0-7\solr-7.3.0-7\server Please check your logs for more information
我从我试图将模型文件放入:D:\utils\solr-7.3.0-7\solr-7.3.0-7\server
,但这没有帮助.
I tried to put model files to: D:\utils\solr-7.3.0-7\solr-7.3.0-7\server
but it didn't help.
这是我的相关问题:也许我需要将模型文件放在其他地方?
Maybe I need to put model files somewhere else?
推荐答案
您需要将这些文件("en-sent.bin"
和另一个)放入内核的conf目录中.
You need to put those files ("en-sent.bin"
and the other one) into core's conf directory.
就是D:\utils\solr-7.3.0-7\solr-7.3.0-7\server\{core_name}\conf
.
然后直接使用文件.以下应该是xml配置.
Then use the files directly. Following should be the xml configuration.
<tokenizer class="solr.OpenNLPTokenizerFactory"
sentenceModel="en-sent.bin"
tokenizerModel="en-token.bin"
/>
这篇关于SolrCloud OpenNLP错误在类路径或"/configs/_default"中找不到资源"opennlp/en-sent.bin"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!