ZF-4071: Lucene doesn't work on 64-bit
I tried Zend_Search_Lucene on a 32 bit and all was fine. Trying on a 64 bit simply doesn't work. The same index correctly opened on the 32 bit machine raises an exception on 64 bit. Looking in the code I discovered that there's a problem with integer precision: on line 422 of Zend/Search/Lucene.php the code:
$numField = $segmentsFile->readInt();
gives -1 on 32 bit, 4294967295 on 64 bit, reading the same index.
moreover, on line 425 the code
if ($numField != (int)0xFFFFFFFF)
fails, since 0xFFFFFFFF has a different value on 32 bit and 64 bit. As workaround I changed numField to -1 and skipped the check and it works. So I think it's sufficent to change the test and the readInt function.