1
votes

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
Error cause was due to lucene-2899 patch not applied to the opennlp trunk.Applied now and working fine.arun abraham

1 Answers

0
votes

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