Forum: Ruby Trying to open a Lucene-built index with Ferret...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E14ef2fea2bc08372df32cf3fe036365?d=identicon&s=25 John Pritchard-williams (monojohnny)
on 2008-11-02 23:04
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
D1f1c20467562fc1d8c8aa0d328def62?d=identicon&s=25 Florian Gilcher (skade)
on 2008-11-02 23:22
(Received via mailing list)
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 Gilcher
E14ef2fea2bc08372df32cf3fe036365?d=identicon&s=25 John Pritchard-williams (monojohnny)
on 2008-11-02 23:46
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
D1f1c20467562fc1d8c8aa0d328def62?d=identicon&s=25 Florian Gilcher (skade)
on 2008-11-03 00:59
(Received via mailing list)
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 Gilcher
457cf540784a12ba2f30e06565a2c189?d=identicon&s=25 Hugh Sasse (Guest)
on 2008-11-03 13:25
(Received via mailing list)
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
This topic is locked and can not be replied to.