user1034461
user1034461

Reputation:

Explore / browse Lucene index by Hibernate search

Is there any way to browse / explore Lucene index created by Hibernate Search? I am aware of Luke embedded inside Lucene bundle, but such a shitty software is unable to open my index. Here is what I have:

Any attempt to open my index end up with an exception such a "Unknown error" or such a nonsense. Also I don't know what directory implementation I have as I use Hibernate Search without configuring directory implementation. Thanks!

[2021-04-11T02:26:17,500] ERROR (OpenIndexDialogFactory.java:355) - Error opening index or directory
java.lang.UnsatisfiedLinkError: no WindowsDirectory in java.library.path: [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:31,751]  INFO (IndexUtils.java:121) - DirectoryReader successfully opened. Directory path=F:\storage\TheVegCat.development\lucene\com.thevegcat.app.entities.article.Article
[2021-04-11T02:26:35,757]  INFO (IndexUtils.java:161) - Directory successfully closed.
[2021-04-11T02:26:35,760]  WARN (IndexUtils.java:145) - Invalid directory implementation class: org.apache.lucene.store.NativeUnixDirectory
java.lang.NoSuchMethodException: org.apache.lucene.store.NativeUnixDirectory.(java.nio.file.Path)
    at java.lang.Class.getConstructor0(Class.java:3349) ~[?:?]
    at java.lang.Class.getConstructor(Class.java:2151) ~[?:?]

[2021-04-11T02:26:36,779] ERROR (OpenIndexDialogFactory.java:355) - Error opening index or directory
java.lang.IllegalArgumentException: Invalid directory implementation class: org.apache.lucene.store.NativeUnixDirectory

EDIT: Tried all options and directory implementations with older Luke 5.5.0 as adviced by @andrewjames, but no luck.

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.

P.S. The index is only 500 KB of size and I'm willing to share it with anyone who can give it a try.

Upvotes: 0

Views: 425

Answers (1)

user1034461
user1034461

Reputation:

Well, the magic answer it to restart Luke after each failed attempt to open a directory. Once you get an exception, close Luke and start it again.

Upvotes: 1

Related Questions