java - 如何打开 Lucene 4.3 索引?

标签 java lucene

我是 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/

相关文章:

xml - 数千个文档(pdf 和/或 xml)的可搜索存档的最佳实践

java - 需要解析Hashtable中的数据

java - 使用 VAULT 配置 Wildfly 8.0.0 以加密 keystore 密码时出现无效的 Keystore 格式异常

java - 如果我在创建对象时已经打开连接,是否需要执行 HTTPUrlConnection.connect() ?

php - Elasticsearch post_filter

java - Lucene如何缓存数据?

elasticsearch - Elasticsearch-跳过索引为空或空值的文档

jdbc - 使用 jdbc river 在 elasticsearch 中索引数据时出现 "Too many open files"异常

java - 二叉树:节点数与子树高度之间的除法最大值

javascript - 无法从浏览器的本地存储中删除项目