将openNLP与Solr集成时发生异常 [英] Exception while integrating openNLP with Solr

查看:222
本文介绍了将openNLP与Solr集成时发生异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将openNLP与Solr 6.1.0集成.我已配置了架构和solrconfig文件,如Wiki链接中所述:

I am trying to integrate openNLP with Solr 6.1.0.I configured the schema and solrconfig files as detailed in the wiki link:https://wiki.apache.org/solr/OpenNLP.

对solrconfig.xml文件的更改:

 <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs" regex=".*\.jar" />


<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib" regex="opennlp-.*\.jar" />

架构文件中的更改:

<fieldType name="text_opennlp_nvf" class="solr.TextField" positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.OpenNLPTokenizerFactory"
          tokenizerModel="opennlp/en-token.bin"
        />
        <filter class="solr.OpenNLPFilterFactory"
          posTaggerModel="opennlp/en-pos-maxent.bin"
        />
        <filter class="solr.FilterPayloadsFilterFactory" payloadList="NN,NNS,NNP,NNPS,VB,VBD,VBG,VBN,VBP,VBZ,FW"/>
        <filter class="solr.StripPayloadsFilterFactory"/>
      </analyzer>
    </fieldType>

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

但是当我尝试加载内核时,它的抛出异常:

But when I try to load the core its throwing exception:

创建核心[star]时出错:无法为核心star加载conf:无法 加载架构 D:\ solr-6.1.0 \ solr-6.1.0 \ server \ solr \ star \ conf \ managed-schema:插件 [schema.xml] fieldType"text_opennlp_nvf"的初始化失败:插件 [schema.xml]分析器/令牌生成器的初始化失败:加载类时出错 'solr.OpenNLPTokenizerFactory'

Error creating core [star]: Could not load conf for core star: Can't load schema D:\solr-6.1.0\solr-6.1.0\server\solr\star\conf\managed-schema: Plugin init failure for [schema.xml] fieldType "text_opennlp_nvf": Plugin init failure for [schema.xml] analyzer/tokenizer: Error loading class 'solr.OpenNLPTokenizerFactory'

在/contrib/analysis-extras/lib下添加以下jar:opennlp-brat-annotator-1.7.0,opennlp-maxent-3.0.3,opennlp-morfologik-addon-1.7.0,opennlp-tools-1.7 .0,opennlp-uima-1.7.0.

Following jars are added under /contrib/analysis-extras/lib : opennlp-brat-annotator-1.7.0,opennlp-maxent-3.0.3,opennlp-morfologik-addon-1.7.0,opennlp-tools-1.7.0,opennlp-uima-1.7.0.

我做了很多尝试来修复该错误,但无法找到此错误的原因.

I tried a lot to fix the error but was unable to find the cause of this error.

预先感谢.

推荐答案

您应该首先集成opennlp.通过以下链接应用补丁 https://issues.apache.org/jira/browse /LUCENE-2899 ,那么您应该对蚂蚁进行编译

You should first integrate opennlp. Apply a patch from the following link https://issues.apache.org/jira/browse/LUCENE-2899 then you should ant compile

这篇关于将openNLP与Solr集成时发生异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆