hemant19cse / luke

Automatically exported from code.google.com/p/luke
0 stars 0 forks source link

Luke 3.1.0 can't open an Solr index from version 3.2.0 #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open an generated index from Solr 3.2.0

What is the expected output? What do you see instead?
Expected: Luke can open the index.
See: error message when opening an index: Incompatible format version: 3 
expected 2 or lower

What version of the product are you using? On what operating system?
Version: 3.1.0
OS: OS X 10.6.7

Please provide any additional information below.
It seems that Solr with version 3.2.0 is now generating the index in another 
format and luke can't work with this new index format.

Original issue reported on code.google.com by occur...@gmail.com on 20 Jun 2011 at 12:54

GoogleCodeExporter commented 9 years ago
I managed to get the luke 3.1-branch compiling against solr+lucene 3.2 with 
only small changes (iterator semantics must be used to read from SegmentInfos 
now) - resulting in the attached lukeall-3.2.0.jar file. Hope it is of use and 
can get some of you by until a proper official release is available.

Original comment by simonskr...@gmail.com on 23 Jun 2011 at 12:50

Attachments:

GoogleCodeExporter commented 9 years ago
Just happened to do the same... changes are to the ant build file and one tiny 
source change from get() to info() on line 159 of 
src/org/apache/lucene/index/IndexGate.java

Original comment by hstoer...@gmail.com on 23 Jun 2011 at 12:52

GoogleCodeExporter commented 9 years ago
@hstoer...@gmail.com
Can you please tell me exactly what you've changed in the ant build file, 
because I've tried this now also:
changed in build.xml everything from 3.1.0 to 3.2.0 and in IndexGate.java get() 
to info(), then compiled it and tried to open the generated index from 
Solr-3.2.0, but again got the error message:
Incompatible format version: 3 expected 2 or lower

Original comment by occur...@gmail.com on 27 Jun 2011 at 8:15

GoogleCodeExporter commented 9 years ago
did you try lukeall-3.2.0.jar that simon provided above?

anyway, the build file changes were only to the version numbers (3.1.0 to 
3.2.0). They appear quite often in the file, make sure to catch them all.  And 
maybe also make sure that the lucene 3.1 jar files are deleted.

hth

Original comment by hstoer...@gmail.com on 27 Jun 2011 at 8:35

GoogleCodeExporter commented 9 years ago
Yes, downloaded the provided one from simon and it also worked for me, but I 
wanted to try it on my own - always interested in learning new stuff.

thx a lot

Original comment by occur...@gmail.com on 27 Jun 2011 at 9:05

GoogleCodeExporter commented 9 years ago
I've got this exception (with the 3.2.0 jar file provided above) which means I 
can't view the document.

java.lang.ClassCastException: org.apache.lucene.document.NumericField cannot be 
cast to org.apache.lucene.document.Field
        at org.apache.lucene.document.Document.getFields(Document.java:204)
        at org.getopt.luke.Luke._showDocFields(Unknown Source)

Original comment by merke...@gmail.com on 28 Jun 2011 at 1:42

GoogleCodeExporter commented 9 years ago
the 3.2 jar reads the index fine, but then when you browse the documents, you 
get:

java.lang.ClassCastException: org.apache.lucene.document.NumericField cannot be 
cast to org.apache.lucene.document.Field
        at org.apache.lucene.document.Document.getFields(Document.java:204)
        at org.getopt.luke.Luke._showDocFields(Unknown Source)
        at org.getopt.luke.Luke.access$1200(Unknown Source)
        at org.getopt.luke.Luke$11.execute(Unknown Source)
        at org.getopt.luke.Luke._showDoc(Unknown Source)
        at org.getopt.luke.Luke.showNextDoc(Unknown Source)

Original comment by ikromc...@gmail.com on 28 Jun 2011 at 12:33

GoogleCodeExporter commented 9 years ago
This error was caused by an implicit cast in a deprecated api. I fixed this in 
the upcoming 3.3.0 release. Thanks!

Original comment by sig...@gmail.com on 6 Jul 2011 at 1:05

GoogleCodeExporter commented 9 years ago
I'm still getting errors with r69. Luke.java has several casts to Field instead 
of Fieldable.

java.lang.ClassCastException: org.apache.lucene.document.NumericField cannot be 
cast to org.apache.lucene.document.Field
        at org.getopt.luke.Luke.showTField(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)

Original comment by merke...@gmail.com on 6 Jul 2011 at 3:07

GoogleCodeExporter commented 9 years ago
Actually, there are a ton of left-over references to getFields() as well. Need 
to replace with getFieldables(); e.g. export doesn't work with numeric fields.

Original comment by merke...@gmail.com on 6 Jul 2011 at 3:14

GoogleCodeExporter commented 9 years ago
Please try this patch and report if this works with your index.

Original comment by sig...@gmail.com on 6 Jul 2011 at 3:30

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by sig...@gmail.com on 6 Jul 2011 at 3:30

GoogleCodeExporter commented 9 years ago
I did not try your patch, but it looks like the same changes I've made. 

Original comment by merke...@gmail.com on 7 Jul 2011 at 12:18

GoogleCodeExporter commented 9 years ago
This is fixed in branch_3x, and the upcoming release 3.5.0. Thanks!

Original comment by sig...@gmail.com on 28 Dec 2011 at 3:08