Crash while retrieving term vectors

This program reliably crashes for me (usually a segfault):

require ‘rubygems’
require ‘ferret’

reader=Ferret::Index::IndexReader.new ARGV
fields=reader.field_infos.fields
reader.max_doc.times{|n|
fields.each{|field|
reader.term_vector(n,field)
} unless reader.deleted?(n)
print “.”; STDOUT.flush
}

As you can see, it just goes through the index, retrieving all the term
vectors. I imagine term vectors must be enabled in at least one field to
trigger this…

I’ve seen this problem on two different systems, running debian and
ubuntu. It may well be the result of something I’ve done wrong, but if
so, I don’t know what. If anyone can provide some assistance with or
information about this problem, I’d appreciate it.

On Wed, Nov 22, 2006 at 11:47:42AM -0800, Caleb C. wrote:

} unless reader.deleted?(n)
information about this problem, I’d appreciate it.
hm, I have this snippet running here without problems (Ferret 0.10.13 on
Debian):

i = Ferret::I.new
i << ‘only a short test’
i << ‘another document’
reader = i.reader
fields = reader.field_infos.fields
reader.max_doc.times{|n|
fields.each{|field|
puts reader.term_vector(n,field)
} unless reader.deleted?(n)
print “.”;
STDOUT.flush
}

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66