ZF-4113: Exception opening index on 64bit platforms

Description

I had this exception trying to open a Lucene 2.3 index on 64bit platform:


PHP Notice: Uninitialized string offset: 0 in Zend/Search/Lucene/Storage/File.php on line 161 PHP Notice: Uninitialized string offset: 1 in Zend/Search/Lucene/Storage/File.php on line 162 PHP Notice: Uninitialized string offset: 2 in Zend/Search/Lucene/Storage/File.php on line 163 PHP Notice: Uninitialized string offset: 3 in Zend/Search/Lucene/Storage/File.php on line 164 PHP Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Separate norm files are not supported. Optimize index to use it with Zend_Search_Lucene.' in Zend/Search/Lucene.php:431 Stack trace:

0 Zend/Search/Lucene.php(526): Zend_Search_Lucene->_readSegmentsFile()

1 test_lucene.php(40): Zend_Search_Lucene->__construct('/var/indices/es...')

2 {main}

thrown in Zend/Search/Lucene.php on line 431

The problem seems to be fixed applying this patch:

--- old/Zend/Search/Lucene.php 2008-07-25 20:58:53.000000000 +0200 +++ new/Zend/Search/Lucene.php 2008-08-29 11:11:01.000000000 +0200 @@ -404,7 +404,7 @@ if ($this->_formatVersion == self::FORMAT_2_3) { $docStoreOffset = $segmentsFile->readInt();

  • if ($docStoreOffset != -1) {
  • if ($docStoreOffset != (int)0xFFFFFFFF) { $docStoreSegment = $segmentsFile->readString(); $docStoreIsCompoundFile = $segmentsFile->readByte();

Possibly related to unresolved issue ZF-4071

Comments

This problem still persists.

Fix/patch provided in here works, however thing should be fixed in svn too.

r11416 is still without this fix.

We could reproduce the issue today, the attached patch fixed it.

Still open with 1.7.3 - why?

Fixed