Re: crash while retrieving term vectors

Jens K. wrote:

hm, I have this snippet running here without problems (Ferret 0.10.13 on
Debian):
[snippet snipped]

Jens, thanks for trying it. Your snippet works perfectly for me as well,
so I modified it til I could get it to fail again. I should have
mentioned that I’m working with sizable indexes (10000-1000000 entries).

Anyway, here’s another version that crashes for me. Here I build an
index from my system’s man files:

require ‘rubygems’
require ‘ferret’
require ‘zlib’
i = Ferret::I.new #:path=>‘temp_index’

manfiles=Dir["/usr/share/man/man*/*.gz"]
manfiles.each{|mf|
fd=Zlib::GzipReader.open(mf)
i<<{:text=>fd.read}
fd.close
}

reader=i.reader
reader.max_doc.times{|n|
reader.term_vector(n,:text) unless reader.deleted?(n)
print “.”;
STDOUT.flush
}

This problem seems to be fairly sensitive to initial conditions.
Printing out each term vector as it is found, like you did in your
snippet, makes the problem go away.

I also have 0.10.13, but the problem seems to be common to all the 0.10
series.