我是 Lucene 新手,我正在尝试使用 Luke 打开 Lucene 4.3 索引(我正在使用我的简单 Lucene 4.3.1 应用程序创建),但它一直给我:
Invalid directory at the location, check console for more information. Last exception: 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, SimpleText, Appending]
很好。所以我将代码中使用的Lucene版本设置为Version.LUCENE_43
。我也试过早期的 3.x 版本。我在这里做错了什么?有没有其他可以使用的 Lucene 索引浏览器?
我正在使用 java -jar lukeall-4.0.0-ALPHA.jar
运行 Luke,我告诉它打开我的应用正在生成的索引。
更新:
我已尝试将我的 CLASSPATH 设置为包含 lucene-core:4.3.1:jar。那没有帮助。
Luke 抛出这个错误:
java.lang.IllegalArgumentException:名称为“Lucene42”的 org.apache.lucene.codecs.Codec 类型的 SPI 类不存在。你需要在你的classpath中添加对应的支持该SPI的JAR文件。当前classpath支持以下名称:[Lucene40, Lucene3x, SimpleText, Appending] java.lang.IllegalArgumentException:名称为“Lucene42”的 org.apache.lucene.codecs.Codec 类型的 SPI 类不存在。您需要将支持该SPI的对应JAR文件添加到您的classpath中。当前classpath支持以下名称:[Lucene40, Lucene3x, SimpleText, Appending]
非常感谢!
最佳答案
经过长时间的搜索,我被指示在这里寻找最新的 Luke 版本:Opengrok ,您可以在该站点找到 4.0.0-alpha 之后的 Luke 版本。 Luke 4.4 应该能够读取当前的索引格式,但有一些注意事项。
关于java - 如何打开 Lucene 4.3 索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17534392/