Can't open index built from latest lucence 8.4.1
nikhilraog opened this issue · 6 comments
Please read the README and use the latest Luke (this is already bundled with Lucene).
java.lang.IllegalArgumentException: Could not load codec 'Lucene84'. Did you forget to add lucene-backward-codecs.jar?
at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:420) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:352) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:289) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:61) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.StandardDirectoryReader$1.doBody(StandardDirectoryReader.java:58) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:680) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:81) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:63) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.luke.models.util.IndexUtils$1.preVisitDirectory(IndexUtils.java:82) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.luke.models.util.IndexUtils$1.preVisitDirectory(IndexUtils.java:77) ~[luke-swing-with-deps.jar:?]
at java.nio.file.Files.walkFileTree(Files.java:2677) ~[?:1.8.0_231]
at java.nio.file.Files.walkFileTree(Files.java:2742) ~[?:1.8.0_231]
at org.apache.lucene.luke.models.util.IndexUtils.openIndex(IndexUtils.java:77) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.luke.app.IndexHandler.open(IndexHandler.java:68) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.luke.app.desktop.components.dialog.menubar.OpenIndexDialogFactory$ListenerFunctions.openIndexOrDirectory(OpenIndexDialogFactory.java:337) ~[luke-swing-with-deps.jar:?]
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) ~[?:1.8.0_231]
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) ~[?:1.8.0_231]
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) ~[?:1.8.0_231]
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) ~[?:1.8.0_231]
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) ~[?:1.8.0_231]
at java.awt.Component.processMouseEvent(Component.java:6539) ~[?:1.8.0_231]
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) ~[?:1.8.0_231]
at java.awt.Component.processEvent(Component.java:6304) ~[?:1.8.0_231]
at java.awt.Container.processEvent(Container.java:2239) ~[?:1.8.0_231]
at java.awt.Component.dispatchEventImpl(Component.java:4889) ~[?:1.8.0_231]
at java.awt.Container.dispatchEventImpl(Container.java:2297) ~[?:1.8.0_231]
at java.awt.Component.dispatchEvent(Component.java:4711) ~[?:1.8.0_231]
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) ~[?:1.8.0_231]
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) ~[?:1.8.0_231]
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) ~[?:1.8.0_231]
at java.awt.Container.dispatchEventImpl(Container.java:2283) ~[?:1.8.0_231]
at java.awt.Window.dispatchEventImpl(Window.java:2746) ~[?:1.8.0_231]
at java.awt.Component.dispatchEvent(Component.java:4711) ~[?:1.8.0_231]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) ~[?:1.8.0_231]
at java.awt.EventQueue.access$500(EventQueue.java:97) ~[?:1.8.0_231]
at java.awt.EventQueue$3.run(EventQueue.java:709) ~[?:1.8.0_231]
at java.awt.EventQueue$3.run(EventQueue.java:703) ~[?:1.8.0_231]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_231]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) ~[?:1.8.0_231]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) ~[?:1.8.0_231]
at java.awt.EventQueue$4.run(EventQueue.java:733) ~[?:1.8.0_231]
at java.awt.EventQueue$4.run(EventQueue.java:731) ~[?:1.8.0_231]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_231]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) ~[?:1.8.0_231]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) ~[?:1.8.0_231]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) ~[?:1.8.0_231]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) ~[?:1.8.0_231]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109) ~[?:1.8.0_231]
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190) ~[?:1.8.0_231]
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235) ~[?:1.8.0_231]
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233) ~[?:1.8.0_231]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_231]
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233) ~[?:1.8.0_231]
at java.awt.Dialog.show(Dialog.java:1084) ~[?:1.8.0_231]
at java.awt.Component.show(Component.java:1671) ~[?:1.8.0_231]
at java.awt.Component.setVisible(Component.java:1623) ~[?:1.8.0_231]
at java.awt.Window.setVisible(Window.java:1014) ~[?:1.8.0_231]
at java.awt.Dialog.setVisible(Dialog.java:1005) ~[?:1.8.0_231]
at org.apache.lucene.luke.app.desktop.util.DialogOpener.open(DialogOpener.java:44) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.luke.app.desktop.util.DialogOpener.open(DialogOpener.java:37) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.luke.app.desktop.components.MenuBarProvider$ListenerFunctions.showOpenIndexDialog(MenuBarProvider.java:190) ~[luke-swing-with-deps.jar:?]
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) [?:1.8.0_231]
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) [?:1.8.0_231]
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) [?:1.8.0_231]
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) [?:1.8.0_231]
at javax.swing.AbstractButton.doClick(AbstractButton.java:376) [?:1.8.0_231]
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842) [?:1.8.0_231]
at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:157) [?:1.8.0_231]
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886) [?:1.8.0_231]
at java.awt.Component.processMouseEvent(Component.java:6539) [?:1.8.0_231]
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) [?:1.8.0_231]
at java.awt.Component.processEvent(Component.java:6304) [?:1.8.0_231]
at java.awt.Container.processEvent(Container.java:2239) [?:1.8.0_231]
at java.awt.Component.dispatchEventImpl(Component.java:4889) [?:1.8.0_231]
at java.awt.Container.dispatchEventImpl(Container.java:2297) [?:1.8.0_231]
at java.awt.Component.dispatchEvent(Component.java:4711) [?:1.8.0_231]
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904) [?:1.8.0_231]
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535) [?:1.8.0_231]
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476) [?:1.8.0_231]
at java.awt.Container.dispatchEventImpl(Container.java:2283) [?:1.8.0_231]
at java.awt.Window.dispatchEventImpl(Window.java:2746) [?:1.8.0_231]
at java.awt.Component.dispatchEvent(Component.java:4711) [?:1.8.0_231]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) [?:1.8.0_231]
at java.awt.EventQueue.access$500(EventQueue.java:97) [?:1.8.0_231]
at java.awt.EventQueue$3.run(EventQueue.java:709) [?:1.8.0_231]
at java.awt.EventQueue$3.run(EventQueue.java:703) [?:1.8.0_231]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_231]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) [?:1.8.0_231]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84) [?:1.8.0_231]
at java.awt.EventQueue$4.run(EventQueue.java:733) [?:1.8.0_231]
at java.awt.EventQueue$4.run(EventQueue.java:731) [?:1.8.0_231]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_231]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74) [?:1.8.0_231]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) [?:1.8.0_231]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) [?:1.8.0_231]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_231]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_231]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_231]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_231]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_231]
Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene84' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classpath supports the following names: [Lucene80, Lucene70]
at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:116) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.codecs.Codec.forName(Codec.java:116) ~[luke-swing-with-deps.jar:?]
at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:416) ~[luke-swing-with-deps.jar:?]
... 99 more
From the logs, while I try to open the index created from the sample program under https://lucene.apache.org/core/8_4_0/core/overview-summary.html, modified the temporary index String indexDir = "pathtoDemo/src/main/resources/indexTempDir"; Directory directory = FSDirectory.open(Paths.get(indexDir));
and commented line //IOUtils.rm(indexPath);
tried to open using the luke 8*,
Please read my previous comment - use the latest Luke (8.4.0 or 8.4.1) bundled with Lucene itself. Luke project has been already migrated into Lucene and this repository is no longer maintained. You can open Lucene 8.4.x index only with Luke 8.4+
In short, the Luke version you need is here - Lucene binary package:
https://www.apache.org/dyn/closer.lua/lucene/java/8.4.1/lucene-8.4.1.tgz
Thanks a lot!