java 如何打开 Lucene 4.3 索引?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17534392/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to open a Lucene 4.3 index?
提问by carlspring
I am a Lucene newbie and I am trying to open a Lucene 4.3 index (which I am creating with my simple Lucene 4.3.1 app) using Luke, but it keeps giving me:
我是 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]
该位置的目录无效,请检查控制台以获取更多信息。最后一个异常:java.lang.IllegalArgumentException:名称为“Lucene42”的 org.apache.lucene.codecs.Codec 类型的 SPI 类不存在。您需要将支持这个SPI的对应JAR文件添加到您的类路径中。当前类路径支持以下名称:[Lucene40、Lucene3x、SimpleText、Appending]
Fine. So I set the Lucene version used in the code to Version.LUCENE_43
. I tried earlier 3.x versions as well. What am I doing wrong here? Is there another Lucene index browser one can use?
美好的。所以我将代码中使用的Lucene版本设置为Version.LUCENE_43
. 我也尝试过早期的 3.x 版本。我在这里做错了什么?是否有另一种可以使用的 Lucene 索引浏览器?
I am running Luke using java -jar lukeall-4.0.0-ALPHA.jar
and I am telling it to open the index which my app is producing.
我正在使用 Luke 运行java -jar lukeall-4.0.0-ALPHA.jar
,我告诉它打开我的应用程序生成的索引。
UPDATE:
更新:
I have tried setting my CLASSPATH to include lucene-core:4.3.1:jar. That didn't help.
Luke throws this error:
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] 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]
我尝试将我的 CLASSPATH 设置为包含 lucene-core:4.3.1:jar。那没有帮助。
卢克抛出这个错误:
java.lang.IllegalArgumentException: 名称为“Lucene42”的 org.apache.lucene.codecs.Codec 类型的 SPI 类不存在。您需要将支持此 SPI 的相应 JAR 文件添加到您的类路径中。当前类路径支持以下名称:[Lucene40, Lucene3x, SimpleText, Appending] java.lang.IllegalArgumentException: A SPI class of type org.apache.lucene.codecs名称为“Lucene42”的编解码器不存在。您需要将支持这个SPI的对应JAR文件添加到您的类路径中。当前类路径支持以下名称:[Lucene40、Lucene3x、SimpleText、Appending]
Many thanks!
非常感谢!
采纳答案by teodimoff
There is person who took his time to fix luke for lucene-4.3.1.
有人花时间为 lucene-4.3.1 修复了 luke。
回答by Fuu
After long time searching, I was instructed to look for latest Luke releases here: Opengrok, where you can find versions of Luke past the 4.0.0-alpha available at the site. Luke 4.4 should be able to read the current index format with some caveats.
经过长时间的搜索,我被指示在此处查找最新的 Luke 版本:Opengrok,您可以在其中找到超过 4.0.0-alpha 版本的 Luke 版本。Luke 4.4 应该能够阅读当前的索引格式,但有一些警告。
回答by Renaud
There is a newer repository on github, where one can download releases:
github 上有一个较新的存储库,可以在其中下载版本: