Exception while integrating openNLP with Solr

穿精又带淫゛_ 提交于 2019-12-23 02:25:16

问题


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.

changes made in solrconfig.xml file:

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


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

changes made in schema file:

<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:

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'

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.

Thanks in Advance.


回答1:


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



来源:https://stackoverflow.com/questions/42393492/exception-while-integrating-opennlp-with-solr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!