Trying to open a Lucene-built index with Ferret


#1

But its wipes out the existing index and creates a new empty one - the
pages for Ferret are currently unavailable - just wondering anybody else
has come across this? Is the ‘create=>false’ just not working or do I
have it wrong here ? ( I have also tried : create=>‘false’ - still the
same thing).

Cheers

John

How do I get the version of Ferret I’m using by the way - I would have
posted that here if I knew how !

– Search.rb –
require ‘rubygems’
require ‘ferret’

index=Ferret::I.new(:path => ‘index’, :create=>false);
index.search_each(‘thane’) do |doc,score|
puts doc, score
end
index.close
– end


#2

As far as i know, Ferret-built indexes are not binary-compatible with
Lucene anymore.

To find out the version, open a console and type:

gem list ferret

the highest version behind the ferret gem is the one in use.

Regards,
Florian G.


#3

Thanks Florian, that would be shame if we’ve lost that binary
compatibility ah well…

The version is:

*** LOCAL GEMS ***

ferret (0.11.6, 0.11.4)

And ignoring the Lucene/Ferret thing for the moment - the ‘search.rb’
program above seems to write over the index directory in any case (if I
run it twice , I get new mod times on the ‘segments’ files at least).

Cheers

John


#4

I don’t remember the reasoning behind it, but as far as i know, this
happend quite a while ago.

If you search http://www.ruby-forum.com/forum/5 for it, you might get
more.

I think the ability to use Lucene directly from JRuby already makes
the ability to manipulate it
with ferret a cornercase most people will ignore.

Regards,
Florian G.


#5

On Mon, 3 Nov 2008, John Pritchard-williams wrote:

And ignoring the Lucene/Ferret thing for the moment - the ‘search.rb’
program above seems to write over the index directory in any case (if I
run it twice , I get new mod times on the ‘segments’ files at least).

I have not explicitly checked for this behaviour with the ff.rb
I modified (without touching that bit), but certainly the index is not
rebuilt, that would take ages.
http://www.eng.cse.dmu.ac.uk/~hgs/ruby/ff.rb
http://www.eng.cse.dmu.ac.uk/~hgs/ruby/ferret_helper.rb
See
http://www.eng.cse.dmu.ac.uk/~hgs/ruby/#ff.rb
for a bit of blurb about what I did.
You might like to experiment with that to see if its behaviour is
useful.

[For those reading the archive: that machine is doomed to die, and the
URL will change. I’d like to keep this stuff on the web somewhere, but
I’m not sure how that will work out]

    Hugh