Lucene4.0 使用 Ik analyzer FF版 实现中文分词报错

立志尚早 发布于 2014/06/12 12:10
阅读 690
收藏 0

原本使用的是Lucene4.2 ,为是使搜索效果更好,就使用中文分词组件IK analyzer,最新ik只兼容到4.0,就更换为lucene4.0   然后报了下面的的错。求助!!!

java.lang.IllegalArgumentException: A SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene42' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath.The current classpath supports the following names: [Lucene40, Lucene3x]

at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:104)
at org.apache.lucene.codecs.Codec.forName(Codec.java:95)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:299)
at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:347)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:783)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:630)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:343)
at org.apache.lucene.index.DirectoryReader.indexExists(DirectoryReader.java:322)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:615)
at com.hgj.servlet.TimerIndexServlet$IndexTask.run(TimerIndexServlet.java:92)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
当前系统时间:Thu Jun 12 12:01:01 CST 2014
Lucene4.2开始索引数据库记录......
java.lang.IllegalArgumentException: A SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene42' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath.The current classpath supports the following names: [Lucene40, Lucene3x]
at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:104)
at org.apache.lucene.codecs.Codec.forName(Codec.java:95)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:299)
at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:347)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:783)
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:630)
at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:343)
at org.apache.lucene.index.DirectoryReader.indexExists(DirectoryReader.java:322)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:615)
at com.hgj.servlet.TimerIndexServlet$IndexTask.index(TimerIndexServlet.java:288)
at com.hgj.servlet.TimerIndexServlet$IndexTask.run(TimerIndexServlet.java:109)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
A SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene42' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath.The current classpath supports the following names: [Lucene40, Lucene3x]
加载中
0
立志尚早
立志尚早
坑爹的最后是项目索引目录里有4.2的索引文件!
0
dreamers
dreamers
用 ff_u1版本的路过,测试 了下4.0及4.8的都没有问题。
返回顶部
顶部