Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 通过Hibernate搜索浏览Lucene索引_Java_Spring_Spring Boot_Hibernate_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch - Fatal编程技术网 elasticsearch,Java,Spring,Spring Boot,Hibernate,elasticsearch" /> elasticsearch,Java,Spring,Spring Boot,Hibernate,elasticsearch" />

Java 通过Hibernate搜索浏览Lucene索引

Java 通过Hibernate搜索浏览Lucene索引,java,spring,spring-boot,hibernate,elasticsearch,Java,Spring,Spring Boot,Hibernate,elasticsearch,有没有办法浏览/浏览Hibernate搜索创建的Lucene索引?我知道Lucene包中嵌入了Luke,但这样一个糟糕的软件无法打开我的索引。以下是我所拥有的: 弹簧靴2.4.4 Hibernate Core 5.4.30.Final Hibernate搜索5.11.8.Final Lucene 8.8.1 Java 1.8 视窗10 任何打开我的索引的尝试最终都会出现一个异常,比如“未知错误”或胡说八道。另外,我不知道我有什么目录实现,因为我使用Hibernate搜索而没有配置目录实现。

有没有办法浏览/浏览Hibernate搜索创建的Lucene索引?我知道Lucene包中嵌入了Luke,但这样一个糟糕的软件无法打开我的索引。以下是我所拥有的:

  • 弹簧靴2.4.4
  • Hibernate Core 5.4.30.Final
  • Hibernate搜索5.11.8.Final
  • Lucene 8.8.1
  • Java 1.8
  • 视窗10
任何打开我的索引的尝试最终都会出现一个异常,比如“未知错误”或胡说八道。另外,我不知道我有什么目录实现,因为我使用Hibernate搜索而没有配置目录实现。 谢谢

[2021-04-11T02:26:17500]错误(OpenIndexDialogFactory.java:355)-打开索引或目录时出错 java.lang.UnsatifiedLink错误:java.library.path中没有WINDOWS目录:[C:\Program Files\java\jdk-11.0.10\bin,C:\WINDOWS\Sun\java\bin,C:\WINDOWS\system32,C:\WINDOWS,C:\Program Files\Common Files\Oracle\java\javapath,C:\Program Files(x86)\Common Files\Oracle\java\javapath。。。 [2021-04-11T02:26:31751]信息(IndexUtils.java:121)-DirectoryReader已成功打开。目录路径=F:\storage\TheVegCat.development\lucene\com.TheVegCat.app.entities.article.article [2021-04-11T02:26:35757]信息(IndexUtils.java:161)-目录已成功关闭。 [2021-04-11T02:26:35760]警告(IndexUtils.java:145)-无效的目录实现类:org.apache.lucene.store.NativeUnixDirectory java.lang.NoSuchMethodException:org.apache.lucene.store.NativeUnixDirectory.(java.nio.file.Path) 在java.lang.Class.getConstructor0(Class.java:3349)~[?:?] 在java.lang.Class.getConstructor(Class.java:2151)~[?:?] [2021-04-11T02:26:36779]错误(OpenIndexDialogFactory.java:355)-打开索引或目录时出错 java.lang.IllegalArgumentException:无效的目录实现类:org.apache.lucene.store.NativeUnixDirectory 编辑:使用@andrewjames建议的旧Luke 5.5.0尝试了所有选项和目录实现,但没有成功

C:\...\luke-5.5.0>java -jar .\target\luke-with-deps.jar WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.lucene.store.MMapDirectory$1 (file:/C:/.../luke-5.5.0/target/luke-with-deps.jar) to method java.nio.DirectByteBuffer.cleaner() WARNING: Please consider reporting this to the maintainers of org.apache.lucene.store.MMapDirectory$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release ERROR: java.lang.Exception: there is no valid Lucene index in this directory. C:\…\luke-5.5.0>java-jar。\target\luke-with-deps.jar 警告:发生了非法的反射访问操作 警告:org.apache.lucene.store.MMapDirectory$1(文件:/C:/…/luke-5.5.0/target/luke with deps.jar)对java.nio.DirectByteBuffer.cleaner()方法的非法反射访问 警告:请考虑向Orac.Apache .Lucene .Stury.MMAPrdRead 1美元的维护者报告这一点。 警告:使用--invalize access=warn以启用对进一步非法访问操作的警告 警告:所有非法访问操作将在未来版本中被拒绝 错误:java.lang.Exception:此目录中没有有效的Lucene索引。
另外,索引的大小只有500 KB,我愿意与任何可以尝试的人分享。

好吧,神奇的答案是在每次尝试打开目录失败后重新启动Luke。一旦出现异常,请关闭Luke并重新启动它。

Hibernate搜索倾向于在封面下使用Lucene的旧版本。根据,y我们的版本使用的是Lucene 5.5,而不是Lucene 8。如果您使用的是Lucene 8捆绑的Luke版本,那么,是的,我希望它无法打开使用Lucene 5.5构建的索引。您能否确认您实际使用的是Lucene 8.8.1(如问题中所列)?如果这是您的问题,您可以找到Luke的旧版本。(较新的版本现在与Lucene捆绑在一起,但过去没有。)@andrewjames谢谢!但我不希望失败,但我会支持更多它唯一使用的东西的一个版本。我的意思是,支持当前旧版本与当前版本并行会有多困难?尽管如此,我会尝试使用旧版本,我希望至少在同一版本中支持minior版本build@andrewj艾姆斯只是尝试了一下,当然什么也没发生。尝试了所有目录下的所有选项,我得到的唯一一条错误消息。错误消息的内容将出现在主帖子中。您使用的是Lucene的哪个确切版本?可能是5.5.x,其中x不是0。在我的例子中,我得到的是与Hibernate 5.11.8.Als捆绑在一起的版本5.5.5o、 请参见:。这建议您尝试使用Lucene 5.5.5索引的Luke 6.6.0。 C:\...\luke-5.5.0>java -jar .\target\luke-with-deps.jar WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.lucene.store.MMapDirectory$1 (file:/C:/.../luke-5.5.0/target/luke-with-deps.jar) to method java.nio.DirectByteBuffer.cleaner() WARNING: Please consider reporting this to the maintainers of org.apache.lucene.store.MMapDirectory$1 WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release ERROR: java.lang.Exception: there is no valid Lucene index in this directory.