Zend Framework

Exception opening index on 64bit platforms

Details

  • Type: Patch Patch
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.0RC3
  • Fix Version/s: 1.8.4
  • Component/s: Zend_Search_Lucene
  • Labels:
    None

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

Issue Links

Activity

Hide
Zoran Lazic added a comment -

This problem still persists.

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

r11416 is still without this fix.

Show
Zoran Lazic added a comment - This problem still persists. Fix/patch provided in here works, however thing should be fixed in svn too. r11416 is still without this fix.
Hide
Karsten Dambekalns added a comment -

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

Show
Karsten Dambekalns added a comment - We could reproduce the issue today, the attached patch fixed it.
Hide
Karsten Dambekalns added a comment -

Still open with 1.7.3 - why?

Show
Karsten Dambekalns added a comment - Still open with 1.7.3 - why?
Hide
Alexander Veremyev added a comment -

Fixed

Show
Alexander Veremyev added a comment - Fixed

People

Vote (2)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: